both 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+19/−9 lines, 2 filesdep +semigroupsdep +zerodep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: semigroups, zero
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.Both: getBoth :: Both a -> Maybe a
- Data.Both: instance Alternative Both
- Data.Both: instance Applicative Both
- Data.Both: instance Constructor C1_0Both
- Data.Both: instance Data a => Data (Both a)
- Data.Both: instance Datatype D1Both
- Data.Both: instance Eq a => Eq (Both a)
- Data.Both: instance Foldable Both
- Data.Both: instance Functor Both
- Data.Both: instance Generic (Both a)
- Data.Both: instance Generic1 Both
- Data.Both: instance Monad Both
- Data.Both: instance MonadPlus Both
- Data.Both: instance Monoid a => Monoid (Both a)
- Data.Both: instance Ord a => Ord (Both a)
- Data.Both: instance Read a => Read (Both a)
- Data.Both: instance Selector S1_0_0Both
- Data.Both: instance Show a => Show (Both a)
- Data.Both: instance Traversable Both
- Data.Both: instance Typeable Both
+ Data.Both: [getBoth] :: Both a -> Maybe a
+ Data.Both: instance (GHC.Base.Monoid a, Data.Semigroup.Semigroup a) => GHC.Base.Monoid (Data.Both.Both a)
+ Data.Both: instance Data.Data.Data a => Data.Data.Data (Data.Both.Both a)
+ Data.Both: instance Data.Foldable.Foldable Data.Both.Both
+ Data.Both: instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Data.Both.Both a)
+ Data.Both: instance Data.Semigroup.Semigroup a => Data.Zero.Zero (Data.Both.Both a)
+ Data.Both: instance Data.Traversable.Traversable Data.Both.Both
+ Data.Both: instance GHC.Base.Alternative Data.Both.Both
+ Data.Both: instance GHC.Base.Applicative Data.Both.Both
+ Data.Both: instance GHC.Base.Functor Data.Both.Both
+ Data.Both: instance GHC.Base.Monad Data.Both.Both
+ Data.Both: instance GHC.Base.MonadPlus Data.Both.Both
+ Data.Both: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Both.Both a)
+ Data.Both: instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Both.Both a)
+ Data.Both: instance GHC.Generics.Constructor Data.Both.C1_0Both
+ Data.Both: instance GHC.Generics.Datatype Data.Both.D1Both
+ Data.Both: instance GHC.Generics.Generic (Data.Both.Both a)
+ Data.Both: instance GHC.Generics.Generic1 Data.Both.Both
+ Data.Both: instance GHC.Generics.Selector Data.Both.S1_0_0Both
+ Data.Both: instance GHC.Read.Read a => GHC.Read.Read (Data.Both.Both a)
+ Data.Both: instance GHC.Show.Show a => GHC.Show.Show (Data.Both.Both a)
Files
- Data/Both.hs +14/−6
- both.cabal +5/−3
Data/Both.hs view
@@ -11,19 +11,27 @@ import Data.Data import Data.Foldable import Data.Maybe-import Data.Monoid+import Data.Monoid hiding ((<>))+import Data.Semigroup import Data.Traversable+import Data.Zero import GHC.Generics newtype Both a = Both { getBoth :: Maybe a } deriving (Eq, Ord, Read, Show, Data, Typeable, Generic, Generic1, Functor, Applicative, Alternative, Monad, MonadPlus, Foldable, Traversable) --- | The 'mappend' for 'Maybe' is 'Just' if /either/ of the operands+-- | The '(<>)' for 'Maybe' is 'Just' if /either/ of the operands -- are, whereas here /both/ must be.-instance Monoid a => Monoid (Both a) where- mempty = Both $ Just mempty- mappend (Both (Just x)) (Both (Just y)) = Both . Just $ x <> y- mappend _ _ = Both Nothing+instance Semigroup a => Semigroup (Both a) where+ Both (Just x) <> Both (Just y) = Both . Just $ x <> y+ _ <> _ = Both Nothing++instance (Monoid a, Semigroup a) => Monoid (Both a) where+ mempty = Both $ Just mempty+ mappend = (<>)++instance Semigroup a => Zero (Both a) where+ zero = Both Nothing -- | The 'both' function takes a default value, a function, and a -- 'Both' value. If the inner 'Maybe' value is 'Nothing', the function
both.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: both-version: 0.1.0.0+version: 0.1.1.0 synopsis: Like Maybe, but with a different Monoid instance. description: The Monoid instance for Maybe behaves like so:@@ -42,12 +42,14 @@ source-repository this type: git location: https://github.com/barrucadu/both.git- tag: 0.1.0.0+ tag: 0.1.1.0 library exposed-modules: Data.Both -- other-modules: -- other-extensions: - build-depends: base >=4.7 && <4.9+ build-depends: base >=4.7 && <5.0+ , semigroups >=0.16 && <0.19+ , zero >=0.1 && <0.2 -- hs-source-dirs: default-language: Haskell2010