The both package

[Tags:library, mit]

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

Properties

Versions 0.1.0.0, 0.1.1.0
Dependencies base (>=4.7 && <5.0), semigroups (>=0.16 && <0.19), zero (==0.1.*) [details]
License MIT
Author Michael Walker
Maintainer mike@barrucadu.co.uk
Category Data
Home page https://github.com/barrucadu/both
Bug tracker https://github.com/barrucadu/both/issues
Source repository head: git clone https://github.com/barrucadu/both.git
this: git clone https://github.com/barrucadu/both.git(tag 0.1.1.0)
Uploaded Thu May 26 11:10:13 UTC 2016 by barrucadu
Distributions LTSHaskell:0.1.1.0, NixOS:0.1.1.0, Stackage:0.1.1.0, Tumbleweed:0.1.1.0
Downloads 195 total (8 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-05-26 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees