caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: octachron <octa@polychoron.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] First class module syntax
Date: Fri, 5 May 2017 14:42:55 +0200	[thread overview]
Message-ID: <78fcf5fa-fe83-03f6-7644-561915956d15@polychoron.fr> (raw)
In-Reply-To: <57d0397e-7e96-455f-5c33-b951f7678585@digirati.com.br>

As a counter-example, consider:

     module type s = sig end (* module type names do not need to start 
with a capital *)
     type s = M

Then,  both

     (* f: s → unit *)
     let f (M:s) = ()

and

     (* g: (module s) → unit *)
     let g (module M:s) = ()

are currently valid.

Consequently, allowing "g:(module s)→unit" to be written as

     let g (M:s) = ()

would be ambiguous.

— octachron.

Le 05/05/2017 à 14:28, Andre Nathan a écrit :
> Hi
>
> I was thinking about the syntax for a function taking a module as a
> parameter, i.e.,
>
>    let f (module M : S) = ...
>
> Off the top of my head I couldn't think of anything that would prevent
> the syntax from being like
>
>    let f (M : S) = ...
>
> I can't think of ways in which this would be ambiguously parsed, so I
> was just wondering what led to the choice of requiring the "module"
> keyword in this case.
>
> Cheers,
> Andre
>


  reply	other threads:[~2017-05-05 12:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 12:28 Andre Nathan
2017-05-05 12:42 ` octachron [this message]
2017-05-05 12:54   ` Andre Nathan
2017-05-05 13:08     ` Max Mouratov
2017-05-06  8:00       ` SP

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=78fcf5fa-fe83-03f6-7644-561915956d15@polychoron.fr \
    --to=octa@polychoron.fr \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).