-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Monoid type classes, designed in modular way, distinguish Monoid from Mempty and Semigroup. This design allows mempty operation don't bring Semigroups related constraints until (<>) is used. -- -- Monoid type classes, designed in modular way, distinguish Monoid from -- Mempty and Semigroup. This design allows mempty operation don't bring -- Semigroups related constraints until (<>) is used. @package monoid @version 0.1.9 module Data.Monoids type family Monoids lst :: Constraint class (Mempty a, Semigroup a) => Monoid a mconcat :: Monoid a => [a] -> a type family Semigroups lst :: Constraint type family Mempties lst :: Constraint class Mempty a mempty :: Mempty a => a mempty :: (Mempty a, Monoid a) => a mappend :: Semigroup a => a -> a -> a mappendWith :: Semigroup a => a -> a -> a -> a mappendBetween :: Semigroup a => a -> a -> a -> a mconcat' :: (Foldable t, Monoid a) => t a -> a intersperse :: Foldable f => a -> f a -> [a] intercalate :: (Monoid a, Foldable f) => a -> f a -> a intercalate' :: Monoid a => a -> [a] -> a -- | The class of semigroups (types with an associative binary operation). -- -- Instances should satisfy the associativity law: -- --
class Semigroup a -- | An associative operation. (<>) :: Semigroup a => a -> a -> a -- | Reduce a non-empty list with <> -- -- The default definition should be sufficient, but this can be -- overridden for efficiency. sconcat :: Semigroup a => NonEmpty a -> a -- | Repeat a value n times. -- -- Given that this works on a Semigroup it is allowed to fail if -- you request 0 or fewer repetitions, and the default definition will do -- so. -- -- By making this a member of the class, idempotent semigroups and -- monoids can upgrade this to execute in O(1) by picking -- stimes = stimesIdempotent or stimes = -- stimesIdempotentMonoid respectively. stimes :: (Semigroup a, Integral b) => b -> a -> a infixr 6 <> instance (Data.Monoids.Mempty a, GHC.Base.Semigroup a) => Data.Monoids.Monoid a instance GHC.Base.Monoid a => Data.Monoids.Mempty a instance Data.Monoids.Mempty [a] instance Data.Monoids.Mempty (GHC.Maybe.Maybe a) instance Data.Monoids.Mempty (Data.Map.Internal.Map k a)