both: Like Maybe, but with a different Monoid instance.
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
Downloads
- both-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.1.0, 0.1.1.1, 0.1.1.2 |
---|---|
Dependencies | base (>=4.7 && <4.9) [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 repo | head: git clone https://github.com/barrucadu/both.git this: git clone https://github.com/barrucadu/both.git(tag 0.1.0.0) |
Uploaded | by barrucadu at 2015-08-22T11:52:04Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 2749 total (17 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2015-08-22 [all 1 reports] |