From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3F382BBAF for ; Mon, 9 Aug 2010 01:00:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8EAJLTXkzUNQXamWdsb2JhbACTUoxyFQEBAQEBCAsKBxEiBAMBArMQAY19BYU6iT8 X-IronPort-AV: E=Sophos;i="4.55,339,1278280800"; d="scan'208";a="67404032" Received: from relay03ant.iops.be ([212.53.5.218]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 01:00:27 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by relay03ant.iops.be (Postfix) with ESMTP id B83C46BF009E; Mon, 9 Aug 2010 01:00:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iops.be; h= content-transfer-encoding:content-type:content-type:mime-version :x-mailer:organization:references:in-reply-to:from:from:subject :subject:message-id:date:date:received:received:received; s= scooby; i=postadmin@iops.be; t=1281308423; bh=4mOaMAfgz0MUcTQilW awJCYZvpL8aMMwr2hIoWzlwS0=; b=ViU9twAux+P3+Yhv3IyU0jRpumELd9+z3D wU4BRTMziOQH1sFaP7S5rLyCWQxyNJopkzcCqQ4hsXbVvXxs70N6onRGV3KL0fN1 DImd200mdqsmMoHivJQ8p2US0fI9n8KKQzHIcvEjvsKVg6ajhrpo2AqdOvDnkMxb SfShzuGJA= X-Virus-Scanned: amavisd-new at iops.be Received: from relay03ant.iops.be ([127.0.0.1]) by localhost (bdell028.dcn.iops.be [127.0.0.1]) (amavisd-new, port 10026) with LMTP id Tlv+lve-MUAR; Mon, 9 Aug 2010 01:00:23 +0200 (CEST) Received: from poincare (cust-12-218-109-94.dyn.as47377.net [94.109.218.12]) by relay03ant.iops.be (Postfix) with ESMTP id 9B8706BF0096; Mon, 9 Aug 2010 01:00:18 +0200 (CEST) Received: from localhost ([::1]) by poincare with esmtp (Exim 4.72) (envelope-from ) id 1OiEqo-0008Kz-9T; Mon, 09 Aug 2010 01:00:18 +0200 Date: Mon, 09 Aug 2010 01:00:18 +0200 (CEST) Message-Id: <20100809.010018.162167882947021471.Christophe.Troestler+ocaml@umons.ac.be> To: bluestorm.dylc@gmail.com Cc: jeremy1@gmail.com, caml-list@yquem.inria.fr, fw@deneb.enyo.de Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Christophe TROESTLER In-Reply-To: References: <4c5f194e.8644d80a.7fef.69e6@mx.google.com> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons X-Mailer: Mew version 7.0.50 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0200,:01 notation:01 ocaml:01 delimited:01 overloading:01 infix:01 submodule:01 infix:01 submodule:01 equality:01 On Sun, 8 Aug 2010 23:47:20 +0200, bluestorm wrote: >=20 > >> > > Is there a better approach to polymorphic equality floating arou= nd? > >> > > >> > Besides type classes? =A0I'm not sure. =A0It's probably possible t= o remove > >> > this feature from the language, with a little bit of syntactic > >> > overhead to pass around a matching comparison function. > >> > >> Yes for instance the very concise local opening notation comes in ha= ndy > >> here: > >> > >> if Int.(x =3D 42) then ... else ... > > > > That's very nice. =A0I don't think type classes are conservative enou= gh for > > this project, but this comes very close indeed. > > I haven't really had a chance to explore OCaml 3.12 yet, as it came o= ut > > while I was working on this, but I will give this serious considerati= on. >=20 > This approach is very nice indeed, but to make it practical you have > to have one of the two following features : > - a more restricted form of "open" statement that does not blindly > import *all* the module values This is possible to do with Delimited Overloading (pa_do): http://pa-do.forge.ocamlcore.org/ > - nested modules >=20 > The other way to solve the problem is to put the dangerous infix > operators into a submodule, eg. Infix or Ops. You have a Int module > with int-specific functions that are not likely to silently conflict > with values of other modules, and an Int.Infix module meant to be used > in that "local open" form : Int.Infix(x + 1 =3D 2). This is possible to "import" the overloaded functions form a submodule but has to be done by hand for the moment because there is no consensus on what the name of the submodule should be. My 0.02=A4, C.