As far as I know, you can use fmap
in place of map
in all cases -- the following two are equivalent.
map (*2) [1..10]
fmap (*2) [1..10]
So, since they do the same thing, why does map
even exist? Why can't fmap
just be map
? My guess is it's either for a historical reason, or for performance somehow.