Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] inference engine
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi Vanicat <vanicat@l...>
Subject: Re: [Caml-list] inference engine
skaller <skaller@ozemail.com.au> writes:


[...]


> [Where that's the line number of the place the inference
> was made]
>
> I can understand that inferences are incremental, and there 
> would be a lot of pain tracking *all* the places the data came
> from to make a type inference: I'm not suggesting that.

One could use the new ocaml option -dtype and .annot file, and the
emacs mode that come with. I've never try it yet, but it give type
information inside a source, even if the source does not compile.

> Instead, I tried to suggest that somehow the constraint
> be included as early as possible. Clearly here that is NOT
> the case, or the error would have been detected where
> it actually occured.

there is a problem : one can have a .ml containing :

let f x = x + 1

let f x y = string_of_int (f x) ^ y

and the .mli :

val f : int -> string -> string

then applying the constraint of the .mli to the .ml became difficult
(at least). 

but of course it could be doable.

In such a case I put the constraint into the .ml, helping me to narrow
the error.
[...]


-- 
Rémi Vanicat
remi.vanicat@laposte.net

-------------------
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