Asked • 07/18/19

What does it mean to compose two Functors?

Exercise 5 of the Haskell Typeclassopedia Section 3.2 asks for a proof or counterexample on the statement: *The composition of two Functors is also a Functor.* I thought at first that this was talking about composing the `fmap` methods defined by two separate instances of a `Functor`, but that doesn't really make sense, since the types wouldn't match up as far as I can tell. For two types `f` and `f'`, the types of `fmap` would be `fmap :: (a -> b) -> f a -> f b` and `fmap :: (a -> b) -> f' a -> f' b`, and that doesn't really seem composable. So what does it mean to compose two `Functors`?

1 Expert Answer

By:

Patrick B. answered • 07/18/19

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.