[Haskell-cafe] A functor for two Peano systems
Tom Ellis
tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Mon Apr 5 17:35:19 UTC 2021
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
More information about the Haskell-Cafe
mailing list