Make Prelude's map = fmap

David Luposchainsky dluposchainsky at googlemail.com
Fri Jun 21 23:19:08 CEST 2013


I'm not sure what to think about this. The proposal pretty much boils
down to removing the "f" from "fmap", which is a *very* minor issue.


- Renaming fmap to map will break every single Functor instance so far.

- Defining map = fmap will create two functions with the same name and
functionality. Taken habit away, people will just define fmaps and use
maps. Sounds odd to me, we shouldn't add more DRY than we already have.

- <$> is already a pretty useful alias for fmap. Contrary to the "map"
synonym, it's canonical use is infix, which I would argue is as much
diversity as we could possibly add or need.


Therefore, -1 from my side.

What I'd be willing to go with is deprecating "map" in favour of using
"fmap" everywhere, but my gut tells me others will not like that idea.

David



More information about the Libraries mailing list