[Haskell-cafe] Re: Should `(flip (^^))` work?

Mauricio briqueabraque at yahoo.com
Mon Sep 15 19:09:45 EDT 2008



Rafael C. de Almeida a écrit :
> Derek Elkins wrote:
>> On Mon, 2008-09-15 at 18:42 -0300, Mauricio wrote:
>>> Hi,
>>>
>>> I tested the expression below
>>> and it doesn't work. Is there
>>> some way to achieve that (i.e.,
>>> turning an expression inside
>>> parenthesis into an operator)?
>>>
>>> 2 `(flip (^^))` (3%4)
>> No it shouldn't work.  The fact that the opening and closing marks are the same suggests that it shouldn't.  You can fake it though.
>>
>> x -| f = f x
>> f |- x = f x
>>
>> 2 -| flip (^^) |- (3%4)
>>
> 
> Isn't naming the expression 'flip (^^)' much clearer?

I think that is an interesting question
about programming style. In practical
code I think we should have a balance
between the complexity of big expressions
and the complexity of too many names.

Best,
Maurício



More information about the Haskell-Cafe mailing list