packages feed

semigroups 0.3.4.1 → 0.3.4.2

raw patch · 2 files changed

+44/−2 lines, 2 filesdep +containersdep +taggeddep +void

Dependencies added: containers, tagged, void

Files

Data/Semigroup.hs view
@@ -40,6 +40,15 @@ import Data.Foldable import Data.Traversable +import Data.Void+import Data.Tagged+import Data.Proxy+import Data.Sequence (Seq, (><))+import Data.Set (Set)+import Data.IntSet (IntSet)+import Data.Map (Map)+import Data.IntMap (IntMap)+ #ifdef LANGUAGE_DeriveDataTypeable import Data.Data #endif@@ -170,6 +179,9 @@   mempty = WrapMonoid mempty   WrapMonoid a `mappend` WrapMonoid b = WrapMonoid (a `mappend` b) ++-- | Option is effectively 'Maybe' with a better instance of 'Monoid', built off of an underlying 'Semigroup'+-- instead of an underlying 'Monoid'. newtype Option a = Option    { getOption :: Maybe a } deriving    ( Eq, Ord, Show, Read@@ -227,3 +239,28 @@ -- | This lets you use a 'difference list' of a semigroup as a Monoid. diff :: Semigroup m => m -> Endo m diff = Endo . (<>)++instance Semigroup Void where+  a <> _ = a++instance Semigroup a => Semigroup (Tagged s a) where+  Tagged a <> Tagged b = Tagged (a <> b)++instance Semigroup (Proxy a) where+  Proxy <> Proxy = Proxy++instance Semigroup (Seq a) where+  (<>) = (><)++instance Semigroup IntSet where+  (<>) = mappend++instance Ord a => Semigroup (Set a) where+  (<>) = mappend++instance Semigroup (IntMap v) where+  (<>) = mappend++instance Ord k => Semigroup (Map k v) where+  (<>) = mappend+
semigroups.cabal view
@@ -1,6 +1,6 @@ name:          semigroups category:      Algebra, Data, Data Structures, Math-version:       0.3.4.1+version:       0.3.4.2 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -23,7 +23,12 @@   manual: False  library-  build-depends: base >= 4 && < 4.4+  build-depends: +    base >= 4 && < 4.4, +    void >= 0.4 && < 0.5, +    tagged >= 0.2 && < 0.3, +    containers >= 0.3 && < 0.5+   ghc-options: -Wall   extensions: CPP   if flag(DeriveDataTypeable)