Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Defining a family of functors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-27 (21:12)
From: David Teller <David.Teller@m...>
Subject: Re: [Caml-list] Defining a family of functors
I'd like that, too. I may be wrong but I have the impression that most
of this can already be done with the current type system of OCaml.

Unless I'm mistaken, for first-class modules, you essentially need
* extendable records (aka objects, good thing we already have them)
* existential types (which may be encoded with universal types, and
since we have universal types in classes, there may be a way to to this
* namespace (which I'm sure could be encoded somehow).

Now, the syntax would certainly be awful, but if I'm right it wouldn't
take too much to get these modules into the compiler.


On Tue, 2009-01-27 at 09:47 -0500, Jacques Carette wrote:
> Bottom line: I too very much wish for first-class, higher-order 
> modules.  As O'Caml already has open and closed products (viz rows and 
> records), open and closed sums (viz polymorphic and 'normal' variants), 
> the resulting system could steal back the 'elegant' monicker that has 
> drifted towards Haskell.
> Jacques