Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newtype Box a = Box { getMaybe :: Maybe a }
- deriving (Eq,Show)
- instance Monoid a => Monoid (Box a) where
- mempty = Box $ Just mempty
- mappend (Box Nothing) a = Box Nothing
- mappend a (Box Nothing) = Box Nothing
- mappend (Box a) (Box b) = Box $ mappend a b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement