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 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 D304DBC69 for ; Thu, 9 Nov 2006 18:55:27 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kA9HtJ6n015738 for ; Thu, 9 Nov 2006 18:55:26 +0100 Received: from ppp39-78.lns2.syd6.internode.on.net (HELO rosella) ([59.167.39.78]) by ipmail02.adl2.internode.on.net with ESMTP; 10 Nov 2006 04:25:13 +1030 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CACb4UkU7pydO/2dsb2JhbAA X-IronPort-AV: i="4.09,406,1157293800"; d="scan'208"; a="43514501:sNHT21908250" Subject: Re: [Caml-list] parameterized pattern From: skaller To: brogoff Cc: Jon Harrop , caml-list@yquem.inria.fr In-Reply-To: References: <454FA5F8.5030106@hq.idt.net> <4a708d20611081555i1f860911rfb7a29d31a34ce7a@mail.gmail.com> <200611090519.45998.jon@ffconsultancy.com> <1163062280.28049.110.camel@rosella.wigram> Content-Type: text/plain Date: Fri, 10 Nov 2006 04:55:07 +1100 Message-Id: <1163094907.5339.18.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45536B87.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gcaml:01 unify:01 parser:01 unification:01 unification:01 sourceforge:01 wrote:01 wrote:01 caml-list:01 functions:01 int:01 int:01 closure:01 float:03 float:03 On Thu, 2006-11-09 at 08:22 -0800, brogoff wrote: > On Thu, 9 Nov 2006, skaller wrote: [] > > So it now has first order typeclasses to solve this problem. > > Did you consider GCaml style generic functions? Yes, but they seem a bit harder to implement. The closure is nice though. The example has a type like: { 'a -> 'a -> 'a < [| int -> int -> int | float -> float -> float |] } but I don't know how to unify alternatives. Feels a bit like a GLR parser .. you fork the unification with each case, drop a thread when unification fails, and merge successes into alternatives? -- John Skaller Felix, successor to C++: http://felix.sf.net