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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 0236ABC6A for ; Fri, 13 Oct 2006 14:23:41 +0200 (CEST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9DCNeG2025216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Oct 2006 14:23:40 +0200 Received: from courriel.upmc.fr (courriel3.reseau.jussieu.fr [134.157.0.194]) by shiva.jussieu.fr (8.13.7/jtpda-5.4) with ESMTP id k9DCNMJe042084 ; Fri, 13 Oct 2006 14:23:22 +0200 (CEST) X-Ids: 164 Received: from etu.upmc.fr (localhost [127.0.0.1]) by courriel.upmc.fr (8.13.6/jtpda-5.4) with ESMTP id k9DCNHJS000545 ; Fri, 13 Oct 2006 14:23:22 +0200 (CEST) Received: from out-of.ilog.fr (out-of.ilog.fr [81.80.159.49]) by webmail.etu.upmc.fr (Horde MIME library) with HTTP; Fri, 13 Oct 2006 14:23:17 +0200 Message-ID: <20061013142317.z70cu8q30g40gckc@webmail.etu.upmc.fr> Date: Fri, 13 Oct 2006 14:23:17 +0200 From: Diego Olivier FERNANDEZ PONS To: =?utf-8?b?U3TDqXBoYW5l?= Glondu Cc: caml-list@inria.fr Subject: Re: [Caml-list] Type inference inside exceptions ? References: <20061006201647.1a88vj0tkockc4k8@webmail.etu.upmc.fr> <452D753E.1020607@glondu.net> In-Reply-To: <452D753E.1020607@glondu.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (shiva.jussieu.fr [134.157.0.164]); Fri, 13 Oct 2006 14:23:22 +0200 (CEST) X-Virus-Scanned: ClamAV 0.88.2/2028/Thu Oct 12 22:36:51 2006 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at discorde with ID 452F854C.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 452F853A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; pons:01 pons:01 inference:01 reordering:01 defines:01 node:01 stack:01 discrepancy:01 inference:01 typecheck:01 developping:01 phane:98 steph:98 wrote:01 polymorphic:01 Bonjour, Quoting St=C3=A9phane Glondu : > I don't really understand what you are doing: why do you generate a list > of continuations instead of a single one? Reordering the continuations to continue the computation in an other =20 branch than the deepest try ... fail is a classical technique in =20 combinatorial optimization. The way you order your continuations =20 defines a "node ordering strategy", most usual being : - stack -> depth first search - queue -> limited discrepancy search - priority queue -> best first search > Don't you want a kind of lazy list? I first wrote a code that solves the problem completely. Then I modified the code to handle continuations of the form (unit -> =20 somthing) Then I replaced (unit -> something) with a lazy list Finally I kept the list of continuations but send it back by function =20 return instead of an exception [And type inference DOES work in that =20 case !] I am "complaining" because the compile DOES infer types within =20 exceptions but does not allow you to let him fix the type the way he =20 needs. It only says "It is not what I was expecting, so your function =20 won't compile, sorry". As far as I understand the reason is to avoid polymorphic exceptions =20 but this could have been done just forbidding the final result to be =20 polymorphic or typechecking and not compiling, or giving me a way to =20 just typecheck without creating the value. > Does this code really do what you expect? Reasonably >> lets try ... > > Is this the end of your mail? Unless you want a complete log of everything I tried when developping =20 that code... Diego Olivier