Version française
Home     About     Download     Resources     Contact us    
Browse thread
Custom operators in the revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] Custom operators in the revised syntax
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