
5 Apr
2021
5 Apr
'21
1:35 p.m.
On Mon, Apr 05, 2021 at 12:17:23AM -0500, Galaxy Being wrote:
I'm just not understanding the concept of a functor in this context: I have this [...] It seems there should be just one plus, function that would handle both an Int-based Peano and the MyNum-based Peano, not two. But in this definition
fmap :: (a -> b) -> f a -> f b
The (a -> b) should be "lifted" over the f a -> f b But I can't conceive of how this should all fit together
Are you perhaps confusing the ML notion of "functor" with the Haskell notion of "Functor" (which is just a particular typeclass)? In fact, Haskell's type classes as a whole are probably closer to ML's "functors" than Haskell's "Functor"s are! Tom