add map back to Functor

Bardur Arantsson spam at scientician.net
Fri Feb 8 21:41:52 UTC 2019


On 08/02/2019 19.45, Edward Kmett wrote:
> 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.
> 

+1 for "the way"

Most of these 'migrations' which are mostly syntactic should be
automatable and really should be *automated* via some sort of tool
support. I still haven't experienced a language where this sort of thing
"just works", but IMO gofix and scalafix have sort of the right idea.

(In Haskell we have the luxury of 'only' having to guarantee source
compatibility.)

If people are worried about having to add CPP sections, then I would
submit it's very possible to convert diffs (between pre-fix to post-fix)
to CPP. That, or one can usually create a *-compat library which
contains the CPP and just use that as a dependency. Ugly, yes, but in
practical terms it seems to be quite simple.

Regards,



More information about the Libraries mailing list