monoids-0.2.0.2: Monoids, specialized containers and a general map/reduce frameworkSource codeContentsIndex
Data.Monoid.Monad
Portabilitynon-portable (MPTCs)
Stabilityexperimental
Maintainerekmett@gmail.com
Contents
Actions
MonadPlus Monoid
Lifting Modules
Description
Monoid instances for working with a Monad
Synopsis
newtype Action m = Action {
getAction :: m ()
}
snocAction :: Reducer (m ()) (Action m) => Action m -> m () -> Action m
newtype MonadSum m a = MonadSum {
getMonadSum :: m a
}
newtype Mon f m = Mon {
getMon :: f m
}
Actions
newtype Action m Source
An Action uses glues together Monad actions with (>>) in the manner of mapM_ from Data.Foldable. Any values returned by reduced actions are discarded.
Constructors
Action
getAction :: m ()
show/hide Instances
Monad m => Monoid (Action m)
Monad m => Reducer (m a) (Action m)
snocAction :: Reducer (m ()) (Action m) => Action m -> m () -> Action mSource
Efficiently avoid needlessly rebinding when using snoc on an action that already returns () A rewrite rule automatically applies this when possible
MonadPlus Monoid
newtype MonadSum m a Source
A MonadSum turns any MonadPlus instance into a Monoid. It also provides a Multiplicative instance for a Monad wrapped around a Monoid and asserts that any MonadPlus applied to a Monoid forms a RightSemiNearRing under these operations.
Constructors
MonadSum
getMonadSum :: m a
show/hide Instances
Monad m => Monad (MonadSum m)
Monad m => Functor (MonadSum m)
MonadPlus m => MonadPlus (MonadSum m)
Monad m => Applicative (MonadSum m)
MonadPlus m => Reducer (m a) (MonadSum m a)
Eq (m a) => Eq (MonadSum m a)
Ord (m a) => Ord (MonadSum m a)
Read (m a) => Read (MonadSum m a)
Show (m a) => Show (MonadSum m a)
MonadPlus m => Monoid (MonadSum m a)
(Monad m, Monoid a) => Multiplicative (MonadSum m a)
Lifting Modules
newtype Mon f m Source
if m is a Module over r and f is a Monad then f Mon m is a Module as well
Constructors
Mon
getMon :: f m
show/hide Instances
(Reducer c m, Monad f) => Reducer c (Mon f m)
Monad f => Monad (Mon f)
Functor f => Functor (Mon f)
MonadPlus f => MonadPlus (Mon f)
Eq (f m) => Eq (Mon f m)
Ord (f m) => Ord (Mon f m)
Read (f m) => Read (Mon f m)
Show (f m) => Show (Mon f m)
(Monoid m, Monad f) => Monoid (Mon f m)
(Group m, Monad f) => Group (Mon f m)
Produced by Haddock version 2.4.2