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

2010-07-27 Thread Yves Parès
(??) is misleading, some may be tempted to write things like: func ?? 45 ?? x , forgetting that ?? is just a mere operator, not a syntactic convenience. Unfortunately, Haskell doesn't provide Scala's underscore for partially applied functions: func(56, _, foo, _)

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

2010-07-27 Thread wren ng thornton
aditya siram wrote: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to comprehend. I don't see a need for its existence - maybe

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

2010-07-26 Thread David Virebayre
On Sun, Jul 25, 2010 at 11:53 PM, Edward Z. Yang ezy...@mit.edu wrote: An interesting alternate spin on flip is infix notation combined with partial application, such as:    (`foobar` 3) which is equivalent to    \x - foobar x 3 I frequently use this, although the jury's out on whether

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

2010-07-26 Thread Ivan Miljenovic
On 26 July 2010 16:33, David Virebayre dav.vire+hask...@gmail.com wrote: On Sun, Jul 25, 2010 at 11:53 PM, Edward Z. Yang ezy...@mit.edu wrote: An interesting alternate spin on flip is infix notation combined with partial application, such as:    (`foobar` 3) which is equivalent to    \x

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

2010-07-26 Thread Nils
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

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

2010-07-26 Thread aditya siram
That's just cool. I now reverse my original statement - 'flip' does have it's place in the pantheon of standard Haskell functions. -deech On Mon, Jul 26, 2010 at 3:42 PM, Nils m...@n-sch.de wrote: On 26.07.2010 08:33, David Virebayre wrote: listeEtagTot = concatMap (`listeEtagArm`

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

2010-07-26 Thread Max Rabkin
On Mon, Jul 26, 2010 at 10:42 PM, Nils m...@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

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

2010-07-26 Thread Daniel Fischer
On Monday 26 July 2010 23:25:27, Max Rabkin wrote: It took me a fair while (I'm talking on the order of half a minute) to figure out what that meant, but it's pretty cool. Yeah, really neat. Maybe a different name would be better? How about (??) or it? listeEtagTot = concatMap

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

2010-07-26 Thread Vo Minh Thu
2010/7/26 Daniel Fischer daniel.is.fisc...@web.de: On Monday 26 July 2010 23:25:27, Max Rabkin wrote: It took me a fair while (I'm talking on the order of half a minute) to figure out what that meant, but it's pretty cool. Yeah, really neat. Maybe a different name would be better? How

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

2010-07-26 Thread Vo Minh Thu
2010/7/26 Vo Minh Thu not...@gmail.com: 2010/7/26 Daniel Fischer daniel.is.fisc...@web.de: On Monday 26 July 2010 23:25:27, Max Rabkin wrote: It took me a fair while (I'm talking on the order of half a minute) to figure out what that meant, but it's pretty cool. Yeah, really neat. Maybe a

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

2010-07-26 Thread aditya siram
It seems confusing to alias a function without adding any functionality just to make things slightly easier to read. Instead wouldn't it be better if this idiom were documented on haskell.org? -deech On Mon, Jul 26, 2010 at 4:47 PM, Vo Minh Thu not...@gmail.com wrote: 2010/7/26 Vo Minh Thu

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

2010-07-26 Thread Ozgur Akgun
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 --

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

2010-07-26 Thread Edward Z. Yang
IMO, if you really want a wildcard, just write a lambda... \x - foo 1 x 3 Cheers, Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2010-07-26 Thread Nils Schweinsberg
On 26.07.2010 23:55, Ozgur Akgun wrote: 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

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

2010-07-26 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/26/10 17:53 , aditya siram wrote: It seems confusing to alias a function without adding any functionality just to make things slightly easier to read. Instead wouldn't it be better if this idiom were documented on haskell.org

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

2010-07-26 Thread Bill Atkins
Seconded. On Monday Jul 26, 2010, at 6:24 PM, Edward Z. Yang wrote: IMO, if you really want a wildcard, just write a lambda... \x - foo 1 x 3 Cheers, Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

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

2010-07-25 Thread Antoine Latter
On Sun, Jul 25, 2010 at 4:13 PM, aditya siram aditya.si...@gmail.com wrote: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to

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

2010-07-25 Thread Daniel Fischer
On Sunday 25 July 2010 23:13:16, aditya siram wrote: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to comprehend. I don't see

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

2010-07-25 Thread Edward Z. Yang
Excerpts from aditya siram's message of Sun Jul 25 17:13:16 -0400 2010: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to