add map back to Functor

amindfv at gmail.com amindfv at gmail.com
Sat Feb 9 22:43:57 UTC 2019



> El 8 feb 2019, a las 12:06 PM, Carter Schonwald <carter.schonwald at gmail.com> escribió:
> 
> 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

I'm personally -1 on this even if we had a nice migration plan. (Even though I'm not someone who uses an alternative prelude!). "map" is a simple, helpful function. "fmap" is a nice generalized version. It's not costly in readability or typing to keep them separate.

Also, nearly every module I've written in Haskell has used "map," under the assumption it meant one thing, and changing it to mean something else (even if only generalized) will have more implications than I can go through and inspect. This is similar to how generalizing "length" in the BBP indirectly caused hard-to-track-down bugs.

Lastly, I don't think "pedagogy" can be entirely relegated to "use an alternative prelude". If when I was first evaluating _whether_ to use Haskell I had been told to use "-fno-implicit-prelude" and "import FakePrelude", I'd chafe at essentially being told "pay no attention to the man behind the curtain." If I'd been told that if I wanted to (+1) every element of a list I had to learn a small bit of category theory, I'd have thought "wow, it really is just a language for mathematicians" and likely thought the language wasn't for me. In my view this proposal will make Haskell more intimidating, when we should be trying as much as we can to make it less!

Tom




More information about the Libraries mailing list