
17 Nov
2015
17 Nov
'15
4:41 p.m.
Hi, I have newtype Pair a = P (a, a) deriving (Show) and have made Monoid, Applicative and Functor instances for it. I’m a bit stumped with Monad! instance Monad Pair where return x = P (x, x) and I got brain ache with >>= And really return x = P (x, x) doesn’t seem correct anyway. Would someone please write the Monad with an explanation? Many Thanks Mike