Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE DeriveFunctor #-}
- data F a = F a
- deriving Functor
- data G a = G a
- deriving Functor
- counit :: F (G a) -> a
- counit (F (G a)) = a
- unit :: a -> G (F a)
- unit a = G (F a)
- {-
- *Main> :t unit
- unit :: a -> G (F a)
- *Main> :t fmap counit
- fmap counit :: Functor f => f (F (G b)) -> f b
- *Main> :t fmap counit . unit
- fmap counit . unit :: G b -> G b -- WTF? Shouldn't the type be G (F (G b)) -> G b ?
- -}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement