From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA02192 for caml-red; Fri, 15 Dec 2000 14:00:30 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA09929 for ; Fri, 15 Dec 2000 13:50:41 +0100 (MET) Received: from mail.cs.uu.nl (sunset.cs.uu.nl [131.211.80.32]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eBFCoeX19836 for ; Fri, 15 Dec 2000 13:50:40 +0100 (MET) Received: from silvester.cs.uu.nl (silvester.cs.uu.nl [131.211.80.119]) by mail.cs.uu.nl (Postfix) with SMTP id 320044518; Fri, 15 Dec 2000 13:50:39 +0100 (MET) Received: by silvester.cs.uu.nl (sSMTP sendmail emulation); Fri, 15 Dec 2000 13:50:34 +0100 Date: Fri, 15 Dec 2000 13:50:34 +0100 From: Frank Atanassow To: John Max Skaller Cc: Mattias Waldau , Caml-List Subject: Re: Functions must be explicitly typed, (was Same label in different types, how do people solve this?) Message-ID: <20001215135034.A4008@cs.uu.nl> References: <3A36C815.EBA9AE89@ozemail.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A36C815.EBA9AE89@ozemail.com.au>; from skaller@ozemail.com.au on Wed, Dec 13, 2000 at 11:51:33AM +1100 Sender: weis@pauillac.inria.fr John Max Skaller wrote (on 13-12-00 11:51 +1100): > In Ocaml, terse expression with the _option_ of adding a type > constraint isn't that unreasonable. The real problem is that > the inference engine isn't smart enough to remember _how_ it > deduced a type, and report _both_ locations when there is a > conflict. I have a suspicion this is non-trivial: probably > worth a PhD. :-) Or at least a Master's. And by a fortuitous coincidence, one of our students Bastiaan Heeren wrote a thesis on this essentially this topic. His type inferencer uses heuristics to improve the quality of type-error messages; for example, if x gets assigned type A in 2 places, and type B in only 1 place, then the inferencer reports the latter as the source of the type conflict. You can find his page, and the thesis, here: http://www.cs.uu.nl/people/bastiaan/ There is also some work by Dominic Duggan and Frederick Bent on "type explanation": D. Duggan and Frederick Bent. Explaining type inference. Science of Computer Programming, 27,1, June 1996. Dominic Duggan. Correct Type Explanations ACM ML Workshop, Baltimore, Maryland, September 1998. and an implementation, SML/E: A Type Explanation Facility for Standard ML: http://guinness.cs.stevens-tech.edu/~dduggan/Public/Smle/index.html -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379