3 ms·
It’s even worse than that. Consider data Foo a = Foo (a -> a) This admits neither Functor nor Contravariant. Sadly all you can say is “If you can map, it’
by moomin 7y ago
It’s even worse than that. Consider
data Foo a = Foo (a -> a)
This admits neither Functor nor Contravariant. Sadly all you can say is “If you can map, it’s a functor.”
I always end up finding out more about any subject I actually publish a post about when people read it...
- TheAsprngHacker 7y agoThe other person also mentioned this. It's called invariance. There's also a fourth variance: https://www.benjamin.pizza/posts/2019-01-11-the-fourth-type-of-variance.html https://www.benjamin.pizza/posts/2019-01-11-the-fourth-type-...
- TheAsprngHacker 7y agoThank you for pointing out contravariant functors; I have fixed that sentence in my post and credited you.
- moomin 7y agoOh that’s much more extensive. Like the link to Julie’s work.
- lalaithion 7y agoI believe that you can say "As long as `a` only appears as the last parameter in a higher kinded type, or not as the parameter of any higher kinded type, then you can define a functor over it."