Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Brian Hurt <bhurt@j...>
Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve.
Vincent Hanquez wrote:

>On Wed, May 23, 2007 at 09:16:44AM +1000, skaller wrote:
>  
>
>>On Tue, 2007-05-22 at 18:10 -0400, David Teller wrote:
>>
>>    
>>
>>>* Error messages of the type system are somewhat obscure. The reflex of
>>>many students is "OCaml wants it to be of type XXX", rather than "there
>>>is a contradiction in what I wrote". It would be nice if there was a way
>>>to ask OCaml to display additional information on type errors.
>>>      
>>>
>>This is a long standing peeve of mine. Lets face it: Ocaml just lies.
>>If it has inferred a type, then finds a contradiction, it should
>>report both the location of the contradication AND all of the source
>>lines that contributed to the inference.
>>    
>>
>
>I agree, this is one of the worst thing about ocaml type inference,
>and you sometimes end up to have to put explicit type to functions to
>find the offending lines (usually hundreds lines before the actual line
>that's printed), defeating the whole thing...
>
>Cheers,
>  
>

Hundreds of lines?  I've seen ten's of lines, but never hundreds.

Of course, I generally type annotate at the level of functions at least 
(using .mli files is to be encouraged, IMO).  So type errors generally 
don't escape functions.  And I keep functions reasonably short- tens of 
lines long at most...

Brian