[Haskell-cafe] Is 'flip' really necessary?

Ozgur Akgun ozgurakgun at gmail.com
Mon Jul 26 17:55:45 EDT 2010


I think it is pretty cool as well. But I think there is a problem with
viewing it as a wildcard.

let's say we define the following:

(??) = flip

foo :: a -> b -> c
foo ?? x :: a -> c

Perfect!

But saying ?? can be used as a wildcard might in the following wrong
perception:

foo x ?? :: b -> c -- WRONG

Just a small concern. Other than that, very neat!

On 26 July 2010 21:42, Nils <ml at n-sch.de> wrote:

> On 26.07.2010 08:33, David Virebayre wrote:
>
>> listeEtagTot = concatMap (`listeEtagArm` cfgTypesTringle) listeArmOrd
>>
>
> You can use flip as a "wildcard" aswell:
>
> > listeEtagTot = concatMap (listeEtagArm `flip` cfgTypesTringle)
> listeArmOrd
>
> Makes it even more readable in my opinion, since this really "shows" you
> where the value belongs to.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100726/693e9174/attachment.html


More information about the Haskell-Cafe mailing list