4 ms·
To be honest with you, you're right in that you usually get that one without trying. Most of the things we think of as mappable obey the identity rules.
by opnitro 5y ago
To be honest with you, you're right in that you usually get that one without trying. Most of the things we think of as mappable obey the identity rules.
- tantalor 5y agoI think the confusion is calling anything that doesn't "obey the rules" a map function just because it is named "map". For example, ruby's hash "map" returns an array instead of hash. That's not really a map, is it? Making this useless distinction between "things with map function" and "functors" serves no purpose. It should be "things with real/fake map functions". The name of the function does not matter!
- opnitro 5y agoSure, the name doesn't matter. The type does though. `Functor f => a -> b -> f a -> f b` And it most type systems the law can't easily be captured in the type system.