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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 96E6FBC0A for ; Sun, 13 May 2007 15:13:13 +0200 (CEST) Received: from sigma957.cis.mcmaster.ca (sigma957.CIS.McMaster.CA [130.113.64.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4DDDClw030841 for ; Sun, 13 May 2007 15:13:13 +0200 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.mcmaster.ca [130.113.196.61]) by sigma957.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id l4DDD3PJ008254 for ; Sun, 13 May 2007 09:13:09 -0400 (EDT) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id l4DDCYL9003165 for ; Sun, 13 May 2007 09:12:34 -0400 Received: from [72.143.143.58] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 173154983 for caml-list@inria.fr; Sun, 13 May 2007 09:12:33 -0400 Message-ID: <46470ED4.9060302@mcmaster.ca> Date: Sun, 13 May 2007 09:12:52 -0400 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Custom operators in the revised syntax References: <1884660607.20070511161455@moldavcable.com> <1179041776.24955.124.camel@rosella.wigram> In-Reply-To: <1179041776.24955.124.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 5.3.1.294258, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.5.13.55433 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Miltered: at concorde with ID 46470EE8.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 ocaml:01 camlp:01 haskell:01 polymorphism:01 expansions:01 undecided:01 2007,:98 harmless:98 wrote:01 wrote:01 caml-list:01 functions:01 formulation:01 revised:02 skaller wrote: > On Sat, 2007-05-12 at 22:52 -0700, brogoff wrote: > >> On Sun, 13 May 2007, Nicolas Pouillard wrote: >> >>> I've a tiny patch to do that: >>> >>> 2 ``List.mem`` [1;2;3] >>> >>> I think that extension harmless, any thoughts? >>> >> That looks like a good start. This patch is in the new Revised? >> > > There was a discussion on this previously, and it can be > done now with ordinary Ocaml, no camlp4 needed, and it > can be done much better than the weak Haskell formulation. > > The idea is something like: > > a <+ b +> c > > translates to > > b a c > It is not true that this is equivalent. For example, most Haskellers have learnt the hard way that $ and application are subtly different. The culprit, and the same is true here, is higher-rank polymorphism. With syntax-driven expansions, one can involve rank-2 functions in `` `` quotes, but in-language operators cannot do so (at least without suffering all sorts of other problems). Whether this issue is important enough, that is a completely different question. I personally am undecided on that point. Jacques