Copyright | (c) Edward Kmett 2009 |
---|---|
License | BSD-style |
Maintainer | ekmett@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell98 |
A simple Monoid
transformer that takes a Monoid
m and produces a new m
-Reducer named Self
m
This is useful when you have a generator that already contains monoidal values or someone supplies
the map to the monoid in the form of a function rather than as a Reducer instance. You can just
or getSelf
. reduce
in those scenarios. These behaviors are encapsulated
into the getSelf
. mapReduce
ffold
and foldMap
combinators in Data.Monoid.Combinators respectively.
Documentation
Instances
Functor Self Source # | |
Foldable Self Source # | |
Defined in Data.Semigroup.Self fold :: Monoid m => Self m -> m # foldMap :: Monoid m => (a -> m) -> Self a -> m # foldr :: (a -> b -> b) -> b -> Self a -> b # foldr' :: (a -> b -> b) -> b -> Self a -> b # foldl :: (b -> a -> b) -> b -> Self a -> b # foldl' :: (b -> a -> b) -> b -> Self a -> b # foldr1 :: (a -> a -> a) -> Self a -> a # foldl1 :: (a -> a -> a) -> Self a -> a # elem :: Eq a => a -> Self a -> Bool # maximum :: Ord a => Self a -> a # | |
Traversable Self Source # | |
Traversable1 Self Source # | |
Foldable1 Self Source # | |
Semigroup m => Reducer m (Self m) Source # | |
Semigroup m => Semigroup (Self m) Source # | |
Monoid m => Monoid (Self m) Source # | |