reducers-3.12.3: Semigroups, specialized containers and a general map/reduce framework

Copyright (c) Edward Kmett 2009 BSD-style ekmett@gmail.com experimental portable Trustworthy Haskell98

Data.Semigroup.Self

Description

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 getSelf . reduce or getSelf . mapReduce f in those scenarios. These behaviors are encapsulated into the fold and foldMap combinators in Data.Monoid.Combinators respectively.

# Documentation

newtype Self m Source #

Constructors

 Self FieldsgetSelf :: m
Instances
 Source # Instance detailsDefined in Data.Semigroup.Self Methodsfmap :: (a -> b) -> Self a -> Self b #(<\$) :: a -> Self b -> Self a # Source # Instance detailsDefined in Data.Semigroup.Self Methodsfold :: 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 #toList :: Self a -> [a] #null :: Self a -> Bool #length :: Self a -> Int #elem :: Eq a => a -> Self a -> Bool #maximum :: Ord a => Self a -> a #minimum :: Ord a => Self a -> a #sum :: Num a => Self a -> a #product :: Num a => Self a -> a # Source # Instance detailsDefined in Data.Semigroup.Self Methodstraverse :: Applicative f => (a -> f b) -> Self a -> f (Self b) #sequenceA :: Applicative f => Self (f a) -> f (Self a) #mapM :: Monad m => (a -> m b) -> Self a -> m (Self b) #sequence :: Monad m => Self (m a) -> m (Self a) # Source # Instance detailsDefined in Data.Semigroup.Self Methodstraverse1 :: Apply f => (a -> f b) -> Self a -> f (Self b) #sequence1 :: Apply f => Self (f b) -> f (Self b) # Source # Instance detailsDefined in Data.Semigroup.Self Methodsfold1 :: Semigroup m => Self m -> m #foldMap1 :: Semigroup m => (a -> m) -> Self a -> m #toNonEmpty :: Self a -> NonEmpty a # Semigroup m => Reducer m (Self m) Source # Instance detailsDefined in Data.Semigroup.Self Methodsunit :: m -> Self m Source #snoc :: Self m -> m -> Self m Source #cons :: m -> Self m -> Self m Source # Semigroup m => Semigroup (Self m) Source # Instance detailsDefined in Data.Semigroup.Self Methods(<>) :: Self m -> Self m -> Self m #sconcat :: NonEmpty (Self m) -> Self m #stimes :: Integral b => b -> Self m -> Self m # Monoid m => Monoid (Self m) Source # Instance detailsDefined in Data.Semigroup.Self Methodsmempty :: Self m #mappend :: Self m -> Self m -> Self m #mconcat :: [Self m] -> Self m #