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 (14:48)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] Defining a family of functors
Andrej Bauer wrote:
> Because of problems like these I sometimes wish I had first-class
> modules. I wonder how different that is from having first-class
> polymorphic records, actually. Perhaps a bit of camlp4 to wrap up
> records in module-like notation would do the trick.
If your modules do not define new types, then the main difference is 
that of name spaces (records pollute the global namespace, modules 
define local namespaces).  However, I could not get far with modules 
that only define new values (functions).

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.