Concrete example showing that monads are not closed under composition (with proof)?
Consider this monad which is isomorphic to the (Bool ->) monad: data Pair a = P a a instance Functor Pair where fmap f (P x y) = P (f x) (f y) instance Monad Pair where return x = P x x P a b >>= f = P x y where P x … Read more