Make Prelude's map = fmap
Nikita Volkov
nikita.y.volkov at gmail.com
Sun Jun 23 20:04:12 CEST 2013
Henning, don't forget that noone suggests to remove Data.List.map, which you will still be perfectly able to use qualified when you feel the need to.
To me having the most general functions imported unqualified from Prelude and specific ones qualified seems most natural. After all, why list should have this "data structure by default" status, why not vector, seq or set or whatever?
On Jun 23, 2013, at 9:46 PM, Henning Thielemann <lemming at henning-thielemann.de> wrote:
> My main concern is that we reduce type-safety. If you have a lot of nested Functors, and you apply a nested fmap like in (fmap (fmap (fmap f))) with a polymorphic f, then after adding or removing a functor level the code can probably still be compiled, but is wrong. It is also more difficult to read, since in order to understand (fmap (fmap (fmap f))) you have to infer types mentally, in order to find out that, say, the second fmap is a List.map. These are my general concern with always using the most general function available.
>
> Thus a -1 for this proposal, from me.
More information about the Libraries
mailing list