Make Prelude's map = fmap

Dan Doel dan.doel at gmail.com
Fri Jun 21 23:26:43 CEST 2013


On Fri, Jun 21, 2013 at 4:57 PM, Andreas Abel <andreas.abel at ifi.lmu.de>wrote:

> Frankly, the proposal text does not make clear what exactly you want to do.
>
> I would guess the name 'fmap' was chosen for 'Functor' because 'map' was
> already taken for lists.


About 15 years ago (in Haskell 1.4), 'map' was the name of the method of
the Functor class. Then it was changed to 'fmap' and the monomorphic 'map'
was added.

(Hint: go read the Haskell 1.4 report if you want to see a version of
Haskell that is better than the one we have today in a dozen or so ways. :))


>  So it would make sense to
>
> 1. remove Prelude.map
> 2. make map an alias for fmap
>
> Then, in 50 years from now we can deprecate fmap and remove it in 100
> years from now. ;-)
>

I suspect that is the proposal, although it probably entails getting rid of
Data.List.map (and re-exporting the Functor version) as well to not be a
significant pain.

It is possible to break some things by doing this, but the corner cases
involved ought to be pretty rare.

-- Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130621/a51cf009/attachment.htm>


More information about the Libraries mailing list