English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Partially hiding modules in packages
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-11-28 (18:49)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Re: [Caml-list] Partially hiding modules in packages
blue storm a écrit :
> Regarding your original problem, I've had the same needs and came up
> with a slightly different solution : in order to avoid the additional
> indirection level related to -pack (Foobar.Foo), is used a flattened
> representation by adding a "foobar.ml" file containing only :
>   include Foo
> (and possibly include of other modules in the package). Then the
> foobarl.mli is :
>   type foo_t
>   val initial : foo_t
>   val show : foo_t -> string
> And values can be referred with Foobar.foo, instead of Foobar.Foo.foo.
> Of course this is only useful if you don't want the user to see the
> internal module hierarchy, wich may not be what you had in mind.

Where do you put the foobar.ml? I've been trying it all over, I do not 
see how you can flatten something that you pack.

Do you put foobar.ml at the same level of your directory foobar/, or in 
you directory foobar/ ?

Or am I understanding you wrong?

All the best,

      Guillaume Yziquel