Proposal: flipped fmap in base (again)

This was proposed about 7 years ago, and rejected at the time: https://ghc.haskell.org/trac/ghc/ticket/3962 Is it okay if I revive this argument now? I think it would be useful to have the lens operator <&> in base, which is defined as: (<&>) :: Functor f => f a -> (a -> b) -> f b as <&> f = f <$> as This is analogous to a lifted version of (&) that already present in Data.Function Cheers, Sid

I'm still in favour of this so a +1 from me. For completeness, your proposal should also specify from which module this will be exported and what the fixity and precedence will be. Bas Op 18 feb. 2017 05:41 schreef "Siddhanathan Shanmugam" < siddhanathan+eml@gmail.com>: This was proposed about 7 years ago, and rejected at the time: https://ghc.haskell.org/trac/ghc/ticket/3962 Is it okay if I revive this argument now? I think it would be useful to have the lens operator <&> in base, which is defined as: (<&>) :: Functor f => f a -> (a -> b) -> f b as <&> f = f <$> as This is analogous to a lifted version of (&) that already present in Data.Function Cheers, Sid _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

+1 from me. --Andreas On 18.02.2017 12:01, John Wiegley wrote:
"BvD" == Bas van Dijk
writes: BvD> I'm still in favour of this so a +1 from me.
+1 from me too.
-- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www.cse.chalmers.se/~abela/

For completeness, your proposal should also specify from which module this will be exported and what the fixity and precedence will be.
module Data.Functor, infixl 1, and should not be in prelude.
Those arguments seems to me as compelling today as they were 7 years ago, what has changed meanwhile?
The addition of (&) in base:
https://mail.haskell.org/pipermail/libraries/2013-October/021423.html
-- Sid
On Sat, Feb 18, 2017 at 4:22 AM, Andreas Abel
+1 from me. --Andreas
On 18.02.2017 12:01, John Wiegley wrote:
"BvD" == Bas van Dijk
writes: >
BvD> I'm still in favour of this so a +1 from me.
+1 from me too.
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se http://www.cse.chalmers.se/~abela/

I'm weakly +1 on this proposal. In my experience foo <&> \x -> ... works out as a nice idiom because it avoids having to parenthesize the lambda unlike the usual <$> convention. For me, I can just make lens re-export the Data.Functor version on newer GHCs. -Edward On Sat, Feb 18, 2017 at 12:28 PM, Siddhanathan Shanmugam < siddhanathan+eml@gmail.com> wrote:
For completeness, your proposal should also specify from which module this will be exported and what the fixity and precedence will be.
module Data.Functor, infixl 1, and should not be in prelude.
Those arguments seems to me as compelling today as they were 7 years ago, what has changed meanwhile?
The addition of (&) in base: https://mail.haskell. org/pipermail/libraries/2013-October/021423.html
-- Sid
On Sat, Feb 18, 2017 at 4:22 AM, Andreas Abel
wrote: +1 from me. --Andreas
On 18.02.2017 12:01, John Wiegley wrote:
"BvD" == Bas van Dijk
writes: >> > BvD> I'm still in favour of this so a +1 from me.
+1 from me too.
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se http://www.cse.chalmers.se/~abela/
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

Could we instead have "ffor" which can be used prefix or infix and avoids
the operator soup problem?
On Feb 18, 2017 3:24 PM, "Edward Kmett"
I'm weakly +1 on this proposal. In my experience
foo <&> \x -> ...
works out as a nice idiom because it avoids having to parenthesize the lambda unlike the usual <$> convention.
For me, I can just make lens re-export the Data.Functor version on newer GHCs.
-Edward
On Sat, Feb 18, 2017 at 12:28 PM, Siddhanathan Shanmugam < siddhanathan+eml@gmail.com> wrote:
For completeness, your proposal should also specify from which module this will be exported and what the fixity and precedence will be.
module Data.Functor, infixl 1, and should not be in prelude.
Those arguments seems to me as compelling today as they were 7 years ago, what has changed meanwhile?
The addition of (&) in base: https://mail.haskell.org /pipermail/libraries/2013-October/021423.html
-- Sid
On Sat, Feb 18, 2017 at 4:22 AM, Andreas Abel
wrote: +1 from me. --Andreas
On 18.02.2017 12:01, John Wiegley wrote:
"BvD" == Bas van Dijk
writes: >>> >> BvD> I'm still in favour of this so a +1 from me.
+1 from me too.
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se http://www.cse.chalmers.se/~abela/
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

I am using `for` https://hackage.haskell.org/package/Agda-2.5.2/docs/Agda-Utils-Functor.html and I think taking `for` for Applicative was name theft. On 19.02.2017 23:52, Elliot Cameron wrote:
Could we instead have "ffor" which can be used prefix or infix and avoids the operator soup problem?
On Feb 18, 2017 3:24 PM, "Edward Kmett"
mailto:ekmett@gmail.com> wrote: I'm weakly +1 on this proposal. In my experience
foo <&> \x -> ...
works out as a nice idiom because it avoids having to parenthesize the lambda unlike the usual <$> convention.
For me, I can just make lens re-export the Data.Functor version on newer GHCs.
-Edward
On Sat, Feb 18, 2017 at 12:28 PM, Siddhanathan Shanmugam
mailto:siddhanathan+eml@gmail.com> wrote: > For completeness, your proposal should also specify from which > module this will be exported and what the fixity and precedence will be.
module Data.Functor, infixl 1, and should not be in prelude.
> Those arguments seems to me as compelling today as they were 7 > years ago, what has changed meanwhile?
The addition of (&) in base: https://mail.haskell.org/pipermail/libraries/2013-October/021423.html https://mail.haskell.org/pipermail/libraries/2013-October/021423.html
-- Sid
On Sat, Feb 18, 2017 at 4:22 AM, Andreas Abel
mailto:abela@chalmers.se> wrote: +1 from me. --Andreas
On 18.02.2017 12:01, John Wiegley wrote:
"BvD" == Bas van Dijk
mailto:v.dijk.bas@gmail.com> writes: BvD> I'm still in favour of this so a +1 from me.
+1 from me too.
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se mailto:andreas.abel@gu.se http://www.cse.chalmers.se/~abela/ http://www.cse.chalmers.se/~abela/
_______________________________________________ Libraries mailing list Libraries@haskell.org mailto:Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org mailto:Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www.cse.chalmers.se/~abela/

On Mon, Feb 20, 2017 at 3:42 AM, Andreas Abel
I am using `for`
https://hackage.haskell.org/package/Agda-2.5.2/docs/Agda-Uti ls-Functor.html
and I think taking `for` for Applicative was name theft.
This crime may no longer be charged under the statute of limitations. The federal code provides that no person can be tried or punished for any noncapital offense unless they are indicted or information is instituted within five years of the date the offense was committed. Of course, that is here within the U.S. You might have better luck in the international court of public opinion. =) -Edward

+1 Please, please, please can we have this?
Could we instead have "ffor" which can be used prefix or infix and avoids the operator soup problem?
-1
On Mon, Feb 20, 2017 at 5:56 AM, Edward Kmett
On Mon, Feb 20, 2017 at 3:42 AM, Andreas Abel
wrote: I am using `for`
https://hackage.haskell.org/package/Agda-2.5.2/docs/Agda-Utils-Functor.html
and I think taking `for` for Applicative was name theft.
This crime may no longer be charged under the statute of limitations. The federal code provides that no person can be tried or punished for any noncapital offense unless they are indicted or information is instituted within five years of the date the offense was committed.
Of course, that is here within the U.S. You might have better luck in the international court of public opinion. =)
-Edward
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

For the record, it makes no sense to me to have (<&>) *without* ffor. I am
personally ambivalent about (<&>) in base, but I'd be -1 if it were not
accompanied by ffor.
On Wed, Feb 22, 2017 at 4:16 AM, Joe Hillenbrand
+1 Please, please, please can we have this?
Could we instead have "ffor" which can be used prefix or infix and avoids the operator soup problem?
-1
On Mon, Feb 20, 2017 at 5:56 AM, Edward Kmett
wrote: On Mon, Feb 20, 2017 at 3:42 AM, Andreas Abel
wrote: I am using `for`
Utils-Functor.html
and I think taking `for` for Applicative was name theft.
This crime may no longer be charged under the statute of limitations. The federal code provides that no person can be tried or punished for any noncapital offense unless they are indicted or information is instituted within five years of the date the offense was committed.
Of course, that is here within the U.S. You might have better luck in the international court of public opinion. =)
-Edward
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

I'm very much against the name ffor. Wouldn't forF be a better fit?
On Wed, Feb 22, 2017 at 1:58 PM, Elliot Cameron
For the record, it makes no sense to me to have (<&>) without ffor. I am personally ambivalent about (<&>) in base, but I'd be -1 if it were not accompanied by ffor.
On Wed, Feb 22, 2017 at 4:16 AM, Joe Hillenbrand
wrote: +1 Please, please, please can we have this?
Could we instead have "ffor" which can be used prefix or infix and avoids the operator soup problem?
-1
On Mon, Feb 20, 2017 at 5:56 AM, Edward Kmett
wrote: On Mon, Feb 20, 2017 at 3:42 AM, Andreas Abel
wrote: I am using `for`
https://hackage.haskell.org/package/Agda-2.5.2/docs/Agda-Utils-Functor.html
and I think taking `for` for Applicative was name theft.
This crime may no longer be charged under the statute of limitations. The federal code provides that no person can be tried or punished for any noncapital offense unless they are indicted or information is instituted within five years of the date the offense was committed.
Of course, that is here within the U.S. You might have better luck in the international court of public opinion. =)
-Edward
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

FWIW, I'm less concerned about the precise name of ffor, although it seems
sad to to lose the obvious correlation with fmap.
On Wed, Feb 22, 2017 at 2:37 PM, David Feuer
I'm very much against the name ffor. Wouldn't forF be a better fit?
On Wed, Feb 22, 2017 at 1:58 PM, Elliot Cameron
wrote: For the record, it makes no sense to me to have (<&>) without ffor. I am personally ambivalent about (<&>) in base, but I'd be -1 if it were not accompanied by ffor.
On Wed, Feb 22, 2017 at 4:16 AM, Joe Hillenbrand
wrote: +1 Please, please, please can we have this?
Could we instead have "ffor" which can be used prefix or infix and avoids the operator soup problem?
-1
On Mon, Feb 20, 2017 at 5:56 AM, Edward Kmett
wrote: On Mon, Feb 20, 2017 at 3:42 AM, Andreas Abel
wrote:
I am using `for`
Utils-Functor.html
and I think taking `for` for Applicative was name theft.
This crime may no longer be charged under the statute of limitations. The federal code provides that no person can be tried or punished for any noncapital offense unless they are indicted or information is instituted within five years of the date the offense was committed.
Of course, that is here within the U.S. You might have better luck in the international court of public opinion. =)
-Edward
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

"EC" == Elliot Cameron
writes:
EC> FWIW, I'm less concerned about the precise name of ffor, although it seems EC> sad to to lose the obvious correlation with fmap. Ah, it wasn't until you said that that I understood why "ffor", but now it makes some sense. :) -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2

Heh, I suppose that doesn't help my case much, does it? I "derived" the
name for my own uses many times prior to seeing it elsewhere (most notably
Reflex:
http://hackage.haskell.org/package/reflex/docs/Reflex-Class.html#v:ffor).
Like I said, the name "ffor" isn't wildly important IMO. I don't want to
start the "fmap should be map" debate all over again either.
On Wed, Feb 22, 2017 at 11:51 PM, John Wiegley
"EC" == Elliot Cameron
writes: EC> FWIW, I'm less concerned about the precise name of ffor, although it seems EC> sad to to lose the obvious correlation with fmap.
Ah, it wasn't until you said that that I understood why "ffor", but now it makes some sense. :)
-- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2

There hasn't been any activity in this thread for two weeks. Summary of the
discussion so far:
+4 in favor
+1 weakly in favor
-1 for not being accompanied by ffor
I'll let the committee take over.
On Wed, Feb 22, 2017 at 8:57 PM, Elliot Cameron
Heh, I suppose that doesn't help my case much, does it? I "derived" the name for my own uses many times prior to seeing it elsewhere (most notably Reflex: http://hackage.haskell.org/package/reflex/ docs/Reflex-Class.html#v:ffor). Like I said, the name "ffor" isn't wildly important IMO. I don't want to start the "fmap should be map" debate all over again either.
On Wed, Feb 22, 2017 at 11:51 PM, John Wiegley
wrote: > "EC" == Elliot Cameron
writes: EC> FWIW, I'm less concerned about the precise name of ffor, although it seems EC> sad to to lose the obvious correlation with fmap.
Ah, it wasn't until you said that that I understood why "ffor", but now it makes some sense. :)
-- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

Let's add <&> to Data.Functor then, as there is a reasonably clear consensus and it already sees fairly wide-spread use. I think we should leave ffor to another day and a separate explicit request / discussion, unless someone else on the CLC really wants to pipe up strongly in favor of adding it today. Adding the CLC to the distribution list to hammer out that detail. -Edward On Fri, Mar 10, 2017 at 1:12 AM, Siddhanathan Shanmugam < siddhanathan+eml@gmail.com> wrote:
There hasn't been any activity in this thread for two weeks. Summary of the discussion so far:
+4 in favor +1 weakly in favor -1 for not being accompanied by ffor
I'll let the committee take over.
On Wed, Feb 22, 2017 at 8:57 PM, Elliot Cameron
wrote: Heh, I suppose that doesn't help my case much, does it? I "derived" the name for my own uses many times prior to seeing it elsewhere (most notably Reflex: http://hackage.haskell.org/package/reflex/docs/ Reflex-Class.html#v:ffor). Like I said, the name "ffor" isn't wildly important IMO. I don't want to start the "fmap should be map" debate all over again either.
On Wed, Feb 22, 2017 at 11:51 PM, John Wiegley
wrote: >> "EC" == Elliot Cameron
writes: EC> FWIW, I'm less concerned about the precise name of ffor, although it seems EC> sad to to lose the obvious correlation with fmap.
Ah, it wasn't until you said that that I understood why "ffor", but now it makes some sense. :)
-- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

On Fri, Feb 17, 2017 at 08:40:00PM -0800, Siddhanathan Shanmugam wrote:
This was proposed about 7 years ago, and rejected at the time: https://ghc.haskell.org/trac/ghc/ticket/3962
From that ticket
I'm not in favor of this proposal. Naming trivial compositions puts a complexity tax on all users of the library and we end up with 2*n operators instead of n operators and one flip function. It's trivial to define the function locally or in a helper module.
To elaborate: At work some of our core APIs have gotten dramatically more complex due to their maintainers allowing people, in interest to keep their own code cleaner, to add small helper functions to those APIs. This is now recognized as bad practice and discouraged with a call to "not fear the semicolon"! (We use mostly imperative languages at work.)
(by Johan Tibell) Those arguments seems to me as compelling today as they were 7 years ago, what has changed meanwhile?
participants (9)
-
Andreas Abel
-
Bas van Dijk
-
David Feuer
-
Edward Kmett
-
Elliot Cameron
-
Francesco Ariis
-
Joe Hillenbrand
-
John Wiegley
-
Siddhanathan Shanmugam