Compose Applicative

For this exercise, we asked you to write an Applicative instance for Data.Functor.Compose Compose.

To make sure we’re on the same page, we repeat the Functor instance here.

instance (Functor f, Functor g) => Functor (Compose f g) where
    fmap function (Compose x) = Compose (fmap (fmap function) x)

Sign up for access to the full page, plus the complete archive and all the latest content.