| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
Data.Semigroup
Contents
Description
Synopsis
- class Semigroup a where
- (<>) :: a -> a -> a
- newtype Min a = Min {
- getMin :: a
- newtype Max a = Max {
- getMax :: a
- newtype First a = First {
- getFirst :: a
- newtype Last a = Last {
- getLast :: a
- newtype WrappedMonoid m = WrapMonoid {
- unwrapMonoid :: m
- newtype Dual a = Dual {
- getDual :: a
- newtype Endo a = Endo {
- appEndo :: a -> a
- newtype All = All {}
- newtype Any = Any {}
- newtype Sum a = Sum {
- getSum :: a
- newtype Product a = Product {
- getProduct :: a
- newtype Option a = Option {}
- option :: b -> (a -> b) -> Option a -> b
- diff :: Semigroup m => m -> Endo m
Documentation
Instances
Semigroup [a]
Semigroups
newtype WrappedMonoid m Source
Instances
Monoids from Data.Monoid
newtype Endo a
The monoid of endomorphisms under composition.
newtype All
Boolean monoid under conjunction.
newtype Any
Boolean monoid under disjunction.
newtype Sum a
Monoid under addition.
newtype Product a
Monoid under multiplication.
A better monoid for Maybe
Option is effectively Maybe with a better instance of Monoid , built off of an underlying Semigroup
instead of an underlying Monoid .
Instances