monoids-0.1.20: 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
module Data.Monoid.Reducer
module Data.Ring.Semi.Near
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
}
Documentation
module Data.Monoid.Reducer
module Data.Ring.Semi.Near
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
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 LeftSemiNearRing under these operations.
Constructors
MonadSum
getMonadSum :: m a
show/hide Instances
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)
(Module r m, Monad f) => Module r (Mon f m)
(RightModule r m, Monad f) => RightModule r (Mon f m)
(LeftModule r m, Monad f) => LeftModule r (Mon f m)
Monad f => Monad (Mon f)
Functor f => Functor (Mon f)
MonadPlus f => MonadPlus (Mon f)
Pointed f => Pointed (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.1