Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques Carette <carette@mcmaster.ca>
To: Markus Mottl <markus.mottl@gmail.com>
Cc: Alain Frisch <alain@frisch.fr>, OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] First-class modules in functor bodies
Date: Mon, 20 May 2013 10:07:27 -0400	[thread overview]
Message-ID: <519A2E1F.5000101@mcmaster.ca> (raw)
In-Reply-To: <CAP_800p7HeOHzBeBGzo9U-aEOy2LrANBx1_34+9U-Lxr-G6u5Q@mail.gmail.com>

On 13-05-20 10:01 AM, Markus Mottl wrote:
> On Mon, May 20, 2013 at 3:31 AM, Alain Frisch <alain@frisch.fr> wrote:
>> Here is an counter-example provided by Didier Rémy:
> [snip]
>>      module F(U:sig end) =
>>       (val (if !b then (module X1 : X) else (module X2 : X)) : X)
> Ah, yeah, that's evil.

If only there were an _option_ to have OCaml track state in its types, 
lots of this would be greatly simplified, at least for those OCaml 
programmers willing to do that.

I understand that not tracking state (or other effects) in OCaml types 
is a fundamental design decision that makes OCaml a hybrid 
functional-imperative language.  I just wish I had the option of using 
it purely functionally, and the compiler would then give me all the 
accompanying riches that comes with that choice.

Jacques

      reply	other threads:[~2013-05-20 14:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-19 15:14 Markus Mottl
2013-05-19 23:07 ` Philippe Wang
2013-05-20  0:26   ` Markus Mottl
2013-05-20  7:31 ` Alain Frisch
2013-05-20 14:01   ` Markus Mottl
2013-05-20 14:07     ` Jacques Carette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519A2E1F.5000101@mcmaster.ca \
    --to=carette@mcmaster.ca \
    --cc=alain@frisch.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=markus.mottl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox