
13 Jul
2010
13 Jul
'10
3:20 p.m.
On 13 Jul 2010, at 15:51, Brent Yorgey wrote:
If it really is an instance of the Monoid type class then you could just write:
maybeMonoid :: (Monoid a) => Maybe a -> Maybe a -> a maybeMonoid x y = fromMaybe mempty $ liftM2 mappend x y
actually, looking at it again, it'd be something like maybeMonoid :: (Monoid a) => Maybe a -> Maybe a -> a maybeMonoid :: x y = (fromMaybe mempty x) `mappend` (fromMaybe mempty y) Cheers, Tim