MIT licensed by Michael Walker
Maintained by mike@barrucadu.co.uk

Module documentation for 0.1.1.0

This version can be pinned in stack with:both-0.1.1.0@sha256:561082f042995c6c944171e1dd79e722487f3b2088ce814c5c49dac6faa6223a,1724

The Monoid instance for Maybe behaves like so:

instance Monoid a => Monoid (Maybe a) where
  mappend (Just x) (Just y) = Just $ x <> y
  mappend (Just x) Nothing  = Just x
  mappend Nothing  (Just y) = Just y
  mappend Nothing  Nothing  = Nothing

  mempty = Nothing

Both is a newtype wrapper around Maybe providing this instance:

instance Monoid a => Monoid (Both a) where
  mappend (Just x) (Just y) = Just $ x <> y
  mappend _ _ = Nothing

  mempty = Just mempty
Depends on 3 packages(full list with versions):
comments powered byDisqus