From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B7A66BC6B for ; Wed, 23 May 2007 14:50:11 +0200 (CEST) Received: from smtp.janestcapital.com (www.janestcapital.com [66.155.124.107]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4NCoAad030767 for ; Wed, 23 May 2007 14:50:11 +0200 Received: from [172.25.129.161] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id A88701F8; Wed, 23 May 2007 08:50:15 -0400 Message-ID: <46543875.9010305@janestcapital.com> Date: Wed, 23 May 2007 08:49:57 -0400 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vincent Hanquez Cc: OCaml Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve. References: <1179871823.6966.78.camel@Blefuscu> <1179875804.17533.33.camel@rosella.wigram> <20070523091909.GA8019@snarc.org> In-Reply-To: <20070523091909.GA8019@snarc.org> Content-Type: multipart/alternative; boundary="------------010803030603070804080601" X-Miltered: at concorde with ID 46543882.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 inference:01 inference:01 cheers:01 mli:01 cheers:01 mli:01 23,:98 23,:98 wrote:01 wrote:01 caml-list:01 functions:01 functions:01 This is a multi-part message in MIME format. --------------010803030603070804080601 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010803030603070804080601 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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

--------------010803030603070804080601--