Package Info

ghc-both


Like Maybe, but with a different Monoid instance


Development/Libraries/Haskell

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.


License: MIT
URL: https://hackage.haskell.org/package/both

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.1.1.0-bp150.2.4 info GA Release 2018-08-01 15
  • AArch64
  • ghc-both
  • ghc-both-devel
0.1.1.0-bp150.2.7 info GA Release 2018-07-31 15
  • ppc64le
  • ghc-both
  • ghc-both-devel
0.1.1.0-bp150.2.6 info GA Release 2018-07-30 15
  • x86-64
  • ghc-both
  • ghc-both-devel