Cabal-1.24.0.0: A framework for packaging Haskell software

Safe HaskellNone

Distribution.Compat.Semigroup

Description

Compatibility layer for Data.Semigroup

Synopsis

Documentation

class Monoid a where

Methods

mempty :: a

mappend :: a -> a -> a

mconcat :: [a] -> a

Instances

Monoid Ordering 
Monoid () 
Monoid ByteString 
Monoid ByteString 
Monoid IntSet 
Monoid Any 
Monoid All 
Monoid CDialect 
Monoid Doc 
Monoid BuildInfo 
Monoid BenchmarkInterface 
Monoid Benchmark 
Monoid TestSuiteInterface 
Monoid TestSuite 
Monoid Executable 
Monoid Library 
Monoid ModuleRenaming 
Monoid SetupBuildInfo 
Monoid BenchmarkFlags 
Monoid TestFlags 
Monoid TestShowDetails 
Monoid ReplFlags 
Monoid BuildFlags 
Monoid CleanFlags 
Monoid HaddockFlags 
Monoid HscolourFlags 
Monoid RegisterFlags 
Monoid SDistFlags 
Monoid InstallFlags 
Monoid CopyFlags 
Monoid ConfigFlags 
Monoid AllowNewer 
Monoid GlobalFlags 
Monoid GhcOptions 
Monoid [a] 
Monoid a => Monoid (Maybe a) 
Ord a => Monoid (Set a) 
Monoid (IntMap a) 
Monoid (Seq a) 
Monoid (Endo a) 
Monoid a => Monoid (Dual a) 
Num a => Monoid (Sum a) 
Num a => Monoid (Product a) 
Monoid (Last a) 
Monoid (First a) 
Monoid (Last' a) 
Monoid (Condition a) 
(Semigroup dir, Monoid dir) => Monoid (InstallDirs dir) 
Ord a => Monoid (NubListR a) 
Ord a => Monoid (NubList a)

Monoid operations on NubLists. For a valid Monoid instance we need to satistfy the required monoid laws; identity, associativity and closure.

Identity : by inspection: mempty mappend NubList xs == NubList xs mappend mempty

Associativity : by inspection: (NubList xs mappend NubList ys) mappend NubList zs == NubList xs mappend (NubList ys mappend NubList zs)

Closure : appending two lists of type a and removing duplicates obviously does not change the type.

HasUnitId a => Monoid (PackageIndex a) 
Monoid (Flag a) 
Monoid b => Monoid (a -> b) 
(Monoid a, Monoid b) => Monoid (a, b) 
Ord k => Monoid (Map k v) 
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) 
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) 
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) 

newtype All

Constructors

All 

Fields

getAll :: Bool
 

Instances

Bounded All 
Eq All 
Ord All 
Read All 
Show All 
Monoid All 
Semigroup All 

newtype Any

Constructors

Any 

Fields

getAny :: Bool
 

Instances

Bounded Any 
Eq Any 
Ord Any 
Read Any 
Show Any 
Monoid Any 
Semigroup Any 

newtype Last' a

Cabal's own Last copy to avoid requiring an orphan Binary instance.

Once the oldest binary version we support provides a Binary instance for Last we can remove this one here.

NB: Last is defined differently and not a Monoid

Constructors

Last' 

Fields

getLast' :: Maybe a
 

Instances

Functor Last' 
Applicative Last' 
Eq a => Eq (Last' a) 
Ord a => Ord (Last' a) 
Read a => Read (Last' a) 
Show a => Show (Last' a) 
Generic (Last' a) 
Monoid (Last' a) 
Binary a => Binary (Last' a) 
Semigroup (Last' a) 

gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a

Generically generate a Semigroup (<>) operation for any type implementing Generic. This operation will append two values by point-wise appending their component fields. It is only defined for product types.

 gmappend a (gmappend b c) = gmappend (gmappend a b) c

gmempty :: (Generic a, GMonoid (Rep a)) => a

Generically generate a Monoid mempty for any product-like type implementing Generic.

It is only defined for product types.

 gmappend gmempty a = a = gmappend a gmempty