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=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 97514BC0A for ; Wed, 23 May 2007 23:53:14 +0200 (CEST) Received: from hades.snarc.org (hades.snarc.org [212.85.152.11]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4NLrETg005287 for ; Wed, 23 May 2007 23:53:14 +0200 Received: by hades.snarc.org (Postfix, from userid 1000) id 47AD71B4D7; Wed, 23 May 2007 23:48:23 +0200 (CEST) Date: Wed, 23 May 2007 23:48:23 +0200 To: Brian Hurt Cc: OCaml Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve. Message-ID: <20070523214823.GA16180@snarc.org> References: <1179871823.6966.78.camel@Blefuscu> <1179875804.17533.33.camel@rosella.wigram> <20070523091909.GA8019@snarc.org> <46543875.9010305@janestcapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46543875.9010305@janestcapital.com> X-Warning: Email may contain unsmilyfied humor and/or satire. User-Agent: Mutt/1.5.13 (2006-08-11) From: tab@snarc.org (Vincent Hanquez) X-Miltered: at discorde with ID 4654B7CA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 mismatch:01 mli:01 mli:01 haskell:01 ocaml:01 val:01 cheers:01 23,:98 wrote:01 caml-list:01 inline:01 functions:01 functions:01 int:01 On Wed, May 23, 2007 at 08:49:57AM -0400, Brian Hurt wrote: > Hundreds of lines? I've seen ten's of lines, but never hundreds. It's happening sometimes, and it's a major pain. It usually because you got the wrong type returned, and you got lots of passthrough functions. when it gets into the function that actually do something with the data, ocaml see a mismatch obviously... in this case you want to correct the source function, not where the error happened ... > 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... this is certainly a very good thing to do, but some people doesn't do this unfortunately :( For .mli file, it's not always an advantage to have them; having 2 files to edit each time you make a modification is quite annoying.. I wish there was an inline signature ala Haskell for OCaml, something along the line of: === string.ml ==== val length : string -> int .... let length s = ... .... ================== Cheers, -- Vincent Hanquez