add map back to Functor

Edward Kmett ekmett at gmail.com
Fri Feb 8 18:45:49 UTC 2019


The real problem with this sketch of a proposal is the lack of a nice
migration plan.

If it is top level and just calls fmap, then the distinction requires
random rote memorization of which one you can define.

On the other hand, say you put it in Functor today as an extra member.
Currently everybody has definitions in terms of `fmap`, so you'd need to
make the two definitions mutual. This would mean enlarging the dictionaries
for one of the most common structures in Haskell for a rather far flung
removal that breaks everyone.

If we had a way (say a pragma or other syntactic form) to say that fmap and
map were somehow the 'same name' or something and so that defining one was
the same as defining the other, so that this tax didn't exist, I could see
how we might get there.

That sort of "magic" might be useful for making migration plans to get
sequenceA to be sequence and mapM and traverse without requiring folks to
memorize which one is in the class and which is a top level definition.

Without something like that, I'd remain somewhat inclined against
concocting a complicated migration plan to save one letter.

-Edward

On Fri, Feb 8, 2019 at 12:07 PM Carter Schonwald <carter.schonwald at gmail.com>
wrote:

> harkening back to the old Haskell 1.5 days, Lets have map back in functor.
> it "F"-  strange to not have our lovely maps be functorial by default.
>
> I think it would be a genuine boon for old and new haskellers alike, and
> those who disagree with this change already use alt-preludes for pedagogy
> reasons anyways
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190208/26b1088d/attachment.html>


More information about the Libraries mailing list