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
Teaching bottomline, part 3: what should improve.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-24 (09:51)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve.
On Thu, 2007-05-24 at 10:32 +0200, Vincent Hanquez wrote:
> On Thu, May 24, 2007 at 10:04:21AM +0200, Markus E.L. wrote:

> OCaml let you do that inline when you
> create a module in a file:
> module xx : sig
>   ....
> end = struct
>   ....
> end
> but for a file (which is also a module), you need to have a separate
> file (a .mli) to do that.. and that's my point.

Can't you can fix that by:

module xx : sig .. end = struct
end include xx

That way all the symbols you want are in the .ml

However this isn't really the same as

private val f: int -> int
let f x = ..

which can be done by:

let f (x:int):int = ..

the problem being it is invasive (you have to
edit the function decl instead of writing a 
separate type decl).

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net