Safe Haskell | None |
---|---|
Language | Haskell98 |
Compatibility layer for Data.Semigroup
Documentation
The class of semigroups (types with an associative binary operation).
Since: 4.9.0.0
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat =
foldr
mappend mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
Identity of mappend
An associative operation
Fold a list using the monoid.
For most types, the default definition for mconcat
will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
Boolean monoid under conjunction (&&
).
Boolean monoid under disjunction (||
).
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.
Functor Last' Source # | |
Applicative Last' Source # | |
Eq a => Eq (Last' a) Source # | |
Ord a => Ord (Last' a) Source # | |
Read a => Read (Last' a) Source # | |
Show a => Show (Last' a) Source # | |
Generic (Last' a) Source # | |
Semigroup (Last' a) Source # | |
Monoid (Last' a) Source # | |
Binary a => Binary (Last' a) Source # | |
type Rep (Last' a) Source # | |