Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Automatic generation of mli files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefan Heimann <lists@s...>
Subject: Re: Re: [Caml-list] Automatic generation of mli files
On Fri, Jun 06, 2003 at 02:16:59PM -0500, Brian Hurt wrote:
> On Fri, 6 Jun 2003, Chris Hecker wrote:
> [...]
> 
> Here's one problem I've hit several times.  In the .ml file, I do 
> something like:
> 
> type t = foo * bar * bang
> 
> Then several functions that use type t.  The type inference will come up 
> with types like:
>     val add: foo * bar * bang -> foo -> bar -> bang -> foo * bar * bang
> when what I wanted was:
>     vall add: t -> foo -> bar -> bang -> t
> 
> How do you deal with this?

You could make an annotation in the comment of the method:

(**
  val add: t -> foo -> bar -> bang -> t
*)
let add a x y z = a

Bye,
  Stefan

-- 
Stefan Heimann
http://www.stefanheimann.net :: personal website.
http://cvsshell.sf.net       :: CvsShell, a console based cvs client.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners