| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Compat.Semigroup
Description
Compatibility layer for Data.Semigroup
Documentation
The class of semigroups (types with an associative binary operation).
Since: 4.9.0.0
Methods
Instances
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 =
foldrmappend 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 newtypes and make those instances
of Monoid, e.g. Sum and Product.
Methods
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.
Instances
Boolean monoid under conjunction (&&).
Instances
| Bounded All | |
| Eq All | |
| Data All | Since: 4.8.0.0 |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> All -> c All # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c All # dataTypeOf :: All -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c All) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c All) # gmapT :: (forall b. Data b => b -> b) -> All -> All # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> All -> r # gmapQ :: (forall d. Data d => d -> u) -> All -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> All -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> All -> m All # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> All -> m All # | |
| Ord All | |
| Read All | |
| Show All | |
| Generic All | |
| Semigroup All | Since: 4.9.0.0 |
| Monoid All | Since: 2.1 |
| Binary All | Since: 0.8.4.0 |
| NFData All | Since: 1.4.0.0 |
| type Rep All | |
Boolean monoid under disjunction (||).
Instances
| Bounded Any | |
| Eq Any | |
| Data Any | Since: 4.8.0.0 |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Any -> c Any # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Any # dataTypeOf :: Any -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Any) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Any) # gmapT :: (forall b. Data b => b -> b) -> Any -> Any # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Any -> r # gmapQ :: (forall d. Data d => d -> u) -> Any -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Any -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Any -> m Any # | |
| Ord Any | |
| Read Any | |
| Show Any | |
| Generic Any | |
| Semigroup Any | Since: 4.9.0.0 |
| Monoid Any | Since: 2.1 |
| Binary Any | Since: 0.8.4.0 |
| NFData Any | Since: 1.4.0.0 |
| type Rep Any | |
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.
Instances
| 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 # | |