Re: Flipped function application

An Intermediate Summary: 1) It is clear now, that most people do not want to have (#/&/|>) at the Prelude. So, we can stop the discussion this part of task: if we add function, it will be Data.Function 2) To add or not to add: 2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application The main plea against the proposal is, that code which is written using flipped function application doesn't look like a function style any more. The main argument agree the proposal is, that it is useful function and probably a wide use. 3) Name of function 3.1) Most people are not against the name they do not prefer 3.2) Main candidates are (#), (&) and (|>) 3.3) Main objection from these 3 candidates has (&): it looks like boolean operation 3.4) If we count "Like"s, we have 3 almost identical results for 3 candidates If ratio remains, it could be solved by voting 2 times (3 >>= 2 remains >>= winner) 3.5) We still count rest candidates and alternatives are welcome! 4) Alternatives Andreas Abel suggest to add 2 pure functions and 2 for Functor: ===== I prefer : (<.>) as (.) for Functor (#) - flipped functional composition (<#>) - flipped <$> for Functor (&) as flipped (.) : f & g = g . f We could write: a # (f & g) = (a # f) # g; -- View this message in context: http://haskell.1045720.n5.nabble.com/Flipped-function-application-tp5738131p... Sent from the Haskell - Libraries mailing list archive at Nabble.com.

On Sat, Oct 12, 2013 at 2:39 PM, Wvv
2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application
I think this phrasing is too loaded given the actual numbers. I've counted in this thread, being generous with the +1s (bikeshedding the name counts as an implicit +1) and I find 11 in favor, 7 against and 6 unknown/don't care. Erik

Erik,
Here is the tally from the last time this came up.
http://haskell.1045720.n5.nabble.com/Proposal-Add-amp-to-Data-Function-td572...
At this point I think it mostly comes down to the core libraries decision,
as this issue has been polled to death.
-Edward
On Sat, Oct 12, 2013 at 1:23 PM, Erik Hesselink
On Sat, Oct 12, 2013 at 2:39 PM, Wvv
wrote: 2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application
I think this phrasing is too loaded given the actual numbers. I've counted in this thread, being generous with the +1s (bikeshedding the name counts as an implicit +1) and I find 11 in favor, 7 against and 6 unknown/don't care.
Erik _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1 for a flipped function operator.
It makes reading a pipeline of operations more natural. "x & foo & bar &
baz" means take x, apply foo, then apply bar... it makes the source code
read easily without having to push and pop operations from a mental stack
or reading the source in an unnatural direction "baz $ bar $ foo x".
And when it comes to lenses, I can't imagine not being able to write "foo &
bar .~ x & baz .~ y".
On Sat, Oct 12, 2013 at 8:23 PM, Erik Hesselink
On Sat, Oct 12, 2013 at 2:39 PM, Wvv
wrote: 2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application
I think this phrasing is too loaded given the actual numbers. I've counted in this thread, being generous with the +1s (bikeshedding the name counts as an implicit +1) and I find 11 in favor, 7 against and 6 unknown/don't care.
Erik _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

In my calculus, 13 in favor, 5 against, 2 not against, 5 don't care or neutral. I think that this thread is still important. Hayoo! can't parse "a -> (a -> b) -> b" (bug ?) and if we try to find (&) from Lens, this function has no signature at Hayoo! :) Maybe Hayoo! don't like flipped function application as well. :)) So, I can't say how many packages already have flipped function application. But I know, that at least one package is already added flipped function application and this package is popular! Yes, I'm saying abut Edward's "lens" library. As I understand, Edward choose the name looking which name was favorite in a discussion a year ago. An this is good. (&) it will be de-facto a name for flipped function application if this thread dead. PROPOSAL: /Data.Function.Flipped/ package So, maybe "if you can't resist the process, lead it". I mean we still could choose the name. Who is in favor - we can lead the process not adding function into the base Who is against - you can lead the process with find only one name for flipped function application *This solution satisfy everyone*: 1) Who is against - we don't add (#) into Data.Function and into the base 2) Who is in favor - we add flipped function application in a package and reserve module name and function name We all could choose the name and make a little package not in base: Data.Function.Flipped and add here this 1 function or may be 2 (as Andreas Abel suggested). For example, I prefer (#) = flip ($) and (&) = flip (.) This case: g . f $ x == x # f & g Are you agree? Erik Hesselink wrote
On Sat, Oct 12, 2013 at 2:39 PM, Wvv <
vitea3v@
> wrote:
2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application
I think this phrasing is too loaded given the actual numbers. I've counted in this thread, being generous with the +1s (bikeshedding the name counts as an implicit +1) and I find 11 in favor, 7 against and 6 unknown/don't care.
Erik _______________________________________________ Libraries mailing list
Libraries@
-- View this message in context: http://haskell.1045720.n5.nabble.com/Flipped-function-application-tp5738131p... Sent from the Haskell - Libraries mailing list archive at Nabble.com.

Yes, both `flip (.)` and `flip ($)` make sense. As a lens user with quite
abit of existing code, keeping & as-is and adding # is appealing.
On Sun, Oct 13, 2013 at 12:55 AM, Wvv
In my calculus, 13 in favor, 5 against, 2 not against, 5 don't care or neutral.
I think that this thread is still important.
Hayoo! can't parse "a -> (a -> b) -> b" (bug ?) and if we try to find (&) from Lens, this function has no signature at Hayoo! :) Maybe Hayoo! don't like flipped function application as well. :)) So, I can't say how many packages already have flipped function application.
But I know, that at least one package is already added flipped function application and this package is popular!
Yes, I'm saying abut Edward's "lens" library. As I understand, Edward choose the name looking which name was favorite in a discussion a year ago. An this is good.
(&) it will be de-facto a name for flipped function application if this thread dead.
PROPOSAL: /Data.Function.Flipped/ package
So, maybe "if you can't resist the process, lead it". I mean we still could choose the name.
Who is in favor - we can lead the process not adding function into the base Who is against - you can lead the process with find only one name for flipped function application
*This solution satisfy everyone*: 1) Who is against - we don't add (#) into Data.Function and into the base 2) Who is in favor - we add flipped function application in a package and reserve module name and function name
We all could choose the name and make a little package not in base: Data.Function.Flipped and add here this 1 function or may be 2 (as Andreas Abel suggested).
For example, I prefer (#) = flip ($) and (&) = flip (.)
This case:
g . f $ x == x # f & g
Are you agree?
Erik Hesselink wrote
On Sat, Oct 12, 2013 at 2:39 PM, Wvv <
vitea3v@
> wrote:
2.1) Some people are against this function at all 2.2) Some people do not want to have this function, but not categorically 2.3) Few(?) people doesn't care 2.4) Many people wish to add flipped function application
I think this phrasing is too loaded given the actual numbers. I've counted in this thread, being generous with the +1s (bikeshedding the name counts as an implicit +1) and I find 11 in favor, 7 against and 6 unknown/don't care.
Erik _______________________________________________ Libraries mailing list
Libraries@
-- View this message in context: http://haskell.1045720.n5.nabble.com/Flipped-function-application-tp5738131p... Sent from the Haskell - Libraries mailing list archive at Nabble.com. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

I analyzed Hackage by Hayoo! to find which libs already implemented flipped function application. Note: Hayoo! do not cover all Hackage. I have next result : ($$) - none package (%) - none package (|>) - none package (&) - lens (inixl 1) reverse apply (inixl 0) SimpleH (inixl 0) Clean (infix ?) (#) - diagrams-lib (inixl 8) util-util (inixr 2) sunroof-comiler (inixr 0) hdirect (inixl 1) hoodle-core (inixr 0) HJScript (inixl 8) funcmp (inixl 0) threepenny-gui (inixl 8) -- View this message in context: http://haskell.1045720.n5.nabble.com/Flipped-function-application-tp5738131p... Sent from the Haskell - Libraries mailing list archive at Nabble.com.

On Tue, 15 Oct 2013 02:48:49 +0400, John Wiegley
Wvv
writes: (%) - none package
It's in base.
But it isn’t a flipped function application. I guess Wvv just wanted to find out which operator for FFA is more popular. ($$) is used in conduit and (|>) in Data.Sequence, but, again, they denote completely different things.
participants (6)
-
Artyom Kazak
-
Edward Kmett
-
Erik Hesselink
-
John Wiegley
-
Oren Ben-Kiki
-
Wvv