caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Questions concerning modules as first-class values
@ 2010-06-02 13:14 Dario Teixeira
  2010-06-02 13:43 ` [Caml-list] " Julien Signoles
  0 siblings, 1 reply; 8+ messages in thread
From: Dario Teixeira @ 2010-06-02 13:14 UTC (permalink / raw)
  To: caml-list

Hi,

3.12 will bring modules as first-class values to the Ocaml language.  
This is an interesting development whose full range of applications will
surprise us for many years, I suspect.  It also raises a few questions,
two of which I'll throw to the audience.

The first is purely one of terminology.  The table below describes how up 
until now core "elements" of the Ocaml language could be described; note the
use of ad-hoc terms such as "value-ish", "module-ish", and even "elements".
Moreover, since modules are now also first-class "values", the terminology 
is bound to get confusing.  So, what should the proper names for all these
"elements" be?

-------------------------------------------------
|               | 0-arity       | n-arity (n>0) |
-------------------------------------------------
| Valueish      | value         | function      |
|               |               |               |
| Moduleish     | module        | functor       |
-------------------------------------------------


Second, does the promotion of modules to first-class values also extend to
higher-order modules, ie, functors?  For the sake of symmetry I reckon it 
ought to.  As an illustration, consider again the same table, but extended to
a third dimension indicating with a boolean (T or F) whether each "element"
is a first-class "value" (the third dimension is represented after a slash). 
It seems right that the question mark in the functor cell should also be a "T".
But is it?

-------------------------------------------------
|               | 0-arity       | n-arity (n>0) |
-------------------------------------------------
| Valueish      | value/T       | function/T    |
|               |               |               |
| Moduleish     | module/T      | functor/?     |
-------------------------------------------------


Thanks for your time!
Best regards,
Dario Teixeira






^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Caml-list] Questions concerning modules as first-class values
@ 2010-06-02 14:05 Dario Teixeira
  0 siblings, 0 replies; 8+ messages in thread
From: Dario Teixeira @ 2010-06-02 14:05 UTC (permalink / raw)
  To: Julien Signoles; +Cc: caml-list

Hi,

> I disagree with your terminology. Below is the one I use:
>
> ------------------------------------------
> |          | 0-arity     | n-arity (n>0) |
> ------------------------------------------
> | Value    | constant    | function      |
> |          |             |               |
> | Module   | structure   | functor       |
> ------------------------------------------

This terminology is indeed better.  But note that since modules are now
first-class "values", the word "value" itself becomes ambiguous.  I'm not
trying to be picky; I think that having clear, unambiguous terminology is
essential to properly convey a message, particularly to beginners.


> If I well understood what Alain Frisch and Xavier Leroy explained,
> modules (including both structures and functors) become first class
> value: structures may be converted to records and functors to functions;
> and conversely. But I let more informed person confirm this.

I am not sure about the implementation details, but at least syntax-wise
I did not get the impression that structures would be converted to records.
What do you mean, exactly?

Cheers,
Dario Teixeira






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-04  4:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-02 13:14 Questions concerning modules as first-class values Dario Teixeira
2010-06-02 13:43 ` [Caml-list] " Julien Signoles
2010-06-02 16:28   ` Alain Frisch
     [not found]   ` <21533_1275496091_o52GSC5l015052_4C068697.5050007@frisch.fr>
2010-06-02 17:36     ` Eric Cooper
2010-06-03 15:31       ` Alain Frisch
2010-06-04  1:34         ` Jacques Garrigue
2010-06-04  4:59           ` Alain Frisch
2010-06-02 14:05 Dario Teixeira

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).