Proposal: Data.Functor.<.> for `fmap f2 . f1`

I don't know if "I find this very useful" is enough for adding a function to base, but here it goes: infixl 4 <.> (<.>) :: Functor f => (b -> c) -> (a -> f b) -> (a -> f c) f1 <.> f2 = fmap f1 . f2 {-# INLINE (<.>) #-} I first defined this couple of months ago and I find myself looking for this function all the time now. One problem with this is that the name is used by widely used `filepath` library.

That should just be (fmap.fmap).
I don't know if "I find this very useful" is enough for adding a function to base, but here it goes:
infixl 4 <.> (<.>) :: Functor f => (b -> c) -> (a -> f b) -> (a -> f c) f1 <.> f2 = fmap f1 . f2 {-# INLINE (<.>) #-}
I first defined this couple of months ago and I find myself looking for this function all the time now.
One problem with this is that the name is used by widely used `filepath` library. _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Sent with my mu4e

Hi, Am Samstag, den 19.09.2015, 21:30 -0400 schrieb Ömer Sinan Ağacan:
One problem with this is that the name is used by widely used `filepath` library.
I would say that this kills this proposal right away... Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

I also defined this <.> for my own use, see https://hackage.haskell.org/package/Agda-2.4.0/docs/Agda-Utils-Functor.html (<.>) relates to (.) as (<$>) relates to ($). I find myself in quite often in the need of my own "Functor" <.>, and at least 100 times more seldom I require the "filepath" <.>. Do we juggle around filepathes all the time when we program Haskell!? Don't we rather combine functions a lot? So, a conflict with filepath is not the final word. Cheers, Andreas On 20.09.2015 12:03, Joachim Breitner wrote:
Hi,
Am Samstag, den 19.09.2015, 21:30 -0400 schrieb Ömer Sinan Ağacan:
One problem with this is that the name is used by widely used `filepath` library.
I would say that this kills this proposal right away...
Greetings, Joachim
_______________________________________________ Libraries mailing list Libraries@haskell.org 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://www2.tcs.ifi.lmu.de/~abel/

Hello, Lens also uses it for combining indexed lenses: https://hackage.haskell.org/package/lens-4.13/docs/Control-Lens-Indexed.html... Best regards, Marcin Mrotek

On 20 September 2015 at 11:30, Ömer Sinan Ağacan
I don't know if "I find this very useful" is enough for adding a function to base, but here it goes:
infixl 4 <.> (<.>) :: Functor f => (b -> c) -> (a -> f b) -> (a -> f c) f1 <.> f2 = fmap f1 . f2 {-# INLINE (<.>) #-}
I first defined this couple of months ago and I find myself looking for this function all the time now.
One problem with this is that the name is used by widely used `filepath` library.
Apart from the clashing with other libraries, I mislike this because of it's lack of symmetry: to me it seems odd that the Functor is only on one side (admittedly though, the variant of type (b -> f c) -> (a -> f b) -> a -> f c requires Monad rather than just Functor). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

This operator is usually named .: or the like. It is a weaker form of
fmap.fmap.
I'm pretty strongly -1 on including it in base under the <.> name.
I'm less strongly -1 on some .: variant.
-Edward
On Sat, Sep 19, 2015 at 9:30 PM, Ömer Sinan Ağacan
I don't know if "I find this very useful" is enough for adding a function to base, but here it goes:
infixl 4 <.> (<.>) :: Functor f => (b -> c) -> (a -> f b) -> (a -> f c) f1 <.> f2 = fmap f1 . f2 {-# INLINE (<.>) #-}
I first defined this couple of months ago and I find myself looking for this function all the time now.
One problem with this is that the name is used by widely used `filepath` library. _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 20/09/15 22:08, Edward Kmett wrote:
This operator is usually named .: or the like. It is a weaker form of fmap.fmap. '(.:) = (.).(.)' is very common. But given that '(<$>) = (.)' for functions, '(.:) = fmap . fmap' would work.
- -1 on '(<.>)'. +1 on '(.:)'. - -- Alexander alexander@plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJV//ENAAoJENQqWdRUGk8BZmAP/1WfovtSUqj1WcpMq/2tgS3s lasGdQ+Rzw1G340yKkfkjPmHs6OHMKBbuUFCpofmIE5zNZBcK91GZptvbfO4saSd d66Rj/t7h7sl1Jc5JLnJj+UEls+z1ycUsrHOPQgWOqvHwClkMkD2fiV/qPgUGYYP czTsRBLCnTGx3kbebfvBfrCk+rdCwRf/L8EC22ambp8/TCh5j1J4QpfubwNzy6Yh IgHLq+25EzEMkZgxuf3e5wb5M/cJiNCujFcA4x2hOIR/4d6KOWtM+Gxse2T8V4Jr AhwEdj27AQRvZ+vM5khFA7UyfB1Y4yqhWd8BmeisQGnhHvK1gPPfXBvp6K3l/ylf XMePGOAEY7SDreb/Fk6rtlDW1uD5ukbY5RY9dp62OgLBexm/eL/Ywx/OAjRi7r7I iQFV1dOFSCkNwEdf07A062FtaV0pRD+LjocnRodOvTDdACfpDDZFwDD/zbBip58u mCD6vlM7wOcW8eL8Pg/BvwTuRVY+zT1L8b1TpVFRw3y8VtWE2uGPSsdI91g0wQcC HX5g7LLeg8vl55z28TScOD/2jf0uCixwwAOe/r0nWY1+Ifv9J+lzCJQeyr9Ffbif JUfbmBQHek/FDnPKtTcZcGms11tZZF5qMTl7y2FefKNtj+A2ipJeM3n9jzkXWci7 TBeEdz4g/0JJHdGciOug =+oey -----END PGP SIGNATURE-----
participants (8)
-
Alexander Berntsen
-
Andreas Abel
-
Edward Kmett
-
Ivan Lazar Miljenovic
-
Joachim Breitner
-
Marcin Mrotek
-
Phil Scott
-
Ömer Sinan Ağacan