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
Wanted: your feedback on the hierarchy of OCaml Batteries Included
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-18 (22:46)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included
On Tuesday 18 November 2008 22:07:33 Alain Frisch wrote:
> and you want to extend M11, you need to write:
> module M' = struct
>    module M1 = struct
>      module M11 = struct include M.M1.M11 (* extension here *) end
>      module M12 = M.M1.M12
>      module M13 = M.M1.M13
>      ...
>    end
>    module M2 = M.M2
>    module M3 = M.M3
>    ...
> end

Ah, yes. Otherwise you get "Multiple definition of the module name ...".

Perhaps that could be solved with extensive Camlp4 hacking to rename the 
previous modules (even coming from an "include") to avoid the clash?

> Frankly, I don't think that having a nice and well-organized hierarchy
> of modules really matters. Things like having uniform interfaces,
> consistent idioms and compatible types across libraries seem much more
> important to me.

Indeed. I think the current system would withstand an order of magnitude more 
(popular) libraries. I'd also recommend the SML Basis library and F# for 
inspiration: they both contain some great designs.

> Anyway, if a hierarchy is desired, I fail to see any advantage of using "."
> instead of e.g. "_" (easily extensible + does not force you to link
> everything). 

That brings its own problems, of course. You no longer have a real hierarchy 
so you cannot do anything at a given depth in the hierarchy, e.g. apply 
mid-level module to a functor.

No doubt people will want both so we'll end up with an ad-hox mix of "." 
and "_" separators. In that case, I'd prefer to flatten every "_" (assuming 
names didn't clash).

Dr Jon Harrop, Flying Frog Consultancy Ltd.