From: Andreas Rossberg <rossberg@mpi-sws.org>
To: Joel Reymont <joelr1@gmail.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] shortcut to omit the functor keyword
Date: Fri, 25 Mar 2011 20:11:22 +0100 [thread overview]
Message-ID: <4C67E559-A2E4-4958-AE98-C4EA1BB89C08@mpi-sws.org> (raw)
In-Reply-To: <083A0142-982A-42DA-84EB-E3F5D26577E1@gmail.com>
On Mar 25, 2011, at 19.43 h, Joel Reymont wrote:
> Why does the shortcut to omit the functor keyword only exists in
> module definitions but not in signatures?
>
> For example, why do
>
> module type A = sig end;;
> module type B = sig end;;
>
> module type C = functor (X : A) -> functor (Y : B) -> sig end;;
>
> and not
>
> module type C (X : A) (Y : B) = sig end;;
That syntax would suggest that C is a parameterized signature that you
could use like
module M : C(X)(Y)
But that's something entirely different from a functor signature.
> the latter would be consistent with
>
> module C (X : A) (Y : B) = struct end;;
No, it wouldn't - I'd say you are making a category error. It's easy
to see in terms of core types and values, where the latter is
analogous to
let c x y = ...
while the former would be more like
type ('a, 'b) c = ...
and *not* at all
val c : 'a -> 'b -> ...
That is, a parameterized signature would correspond to a type
constructor, while a functor signature corresponds to a function type.
Hope that helps,
/Andreas
next prev parent reply other threads:[~2011-03-25 19:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 18:43 Joel Reymont
2011-03-25 19:10 ` Vincent Aravantinos
2011-03-25 19:11 ` Andreas Rossberg [this message]
2011-03-26 7:35 ` [Caml-list] " Satoshi Ogasawara
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=4C67E559-A2E4-4958-AE98-C4EA1BB89C08@mpi-sws.org \
--to=rossberg@mpi-sws.org \
--cc=caml-list@inria.fr \
--cc=joelr1@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