From: Vincent Aravantinos <vincent.aravantinos@gmail.com>
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 15:10:07 -0400 [thread overview]
Message-ID: <3CD018B0-B00B-4CB0-AAA3-0F8C19EB2E8D@gmail.com> (raw)
In-Reply-To: <083A0142-982A-42DA-84EB-E3F5D26577E1@gmail.com>
It seems to me as similar to the fact that you can write:
type t = int -> int
but not:
type t int = int
even though you can write:
let f = fun x -> x + 1
or:
let f x = x + 1
You're defining the type of a function, not a function over types.
Or, for modules:
You're defining the module type of a functor, not a functor over
module types (not sure I could even call this a functor).
Le 25 mars 11 à 14:43, Joel Reymont a écrit :
> 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;;
>
> the latter would be consistent with
>
> module C (X : A) (Y : B) = struct end;;
>
> --------------------------------------------------------------------------
> - for hire: mac osx device driver ninja, kernel extensions and usb
> drivers
> ---------------------+------------
> +---------------------------------------
> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
> ---------------------+------------
> +---------------------------------------
>
>
>
>
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
next prev parent reply other threads:[~2011-03-25 19:10 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 [this message]
2011-03-25 19:11 ` Andreas Rossberg
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=3CD018B0-B00B-4CB0-AAA3-0F8C19EB2E8D@gmail.com \
--to=vincent.aravantinos@gmail.com \
--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