reducers-3.12.4: Semigroups, specialized containers and a general map/reduce framework
Copyright(c) Edward Kmett 2009
LicenseBSD-style
Maintainerekmett@gmail.com
Stabilityexperimental
Portabilitynon-portable (MPTCs)
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Semigroup.Monad

Description

Semigroups for working with Monads.

Synopsis

Documentation

newtype Action f Source #

A Action uses an glues together monadic actions with (>>) in the manner of mapM_ from Data.Foldable. Any values returned by reduced actions are discarded.

Constructors

Action 

Fields

Instances

Instances details
Monad f => Semigroup (Action f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

(<>) :: Action f -> Action f -> Action f #

sconcat :: NonEmpty (Action f) -> Action f #

stimes :: Integral b => b -> Action f -> Action f #

Monad f => Monoid (Action f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

mempty :: Action f #

mappend :: Action f -> Action f -> Action f #

mconcat :: [Action f] -> Action f #

Monad f => Reducer (f a) (Action f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

unit :: f a -> Action f Source #

snoc :: Action f -> f a -> Action f Source #

cons :: f a -> Action f -> Action f Source #

newtype Mon f m Source #

Constructors

Mon 

Fields

Instances

Instances details
Monad f => Monad (Mon f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

(>>=) :: Mon f a -> (a -> Mon f b) -> Mon f b #

(>>) :: Mon f a -> Mon f b -> Mon f b #

return :: a -> Mon f a #

Functor f => Functor (Mon f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

fmap :: (a -> b) -> Mon f a -> Mon f b #

(<$) :: a -> Mon f b -> Mon f a #

Applicative f => Applicative (Mon f) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

pure :: a -> Mon f a #

(<*>) :: Mon f (a -> b) -> Mon f a -> Mon f b #

liftA2 :: (a -> b -> c) -> Mon f a -> Mon f b -> Mon f c #

(*>) :: Mon f a -> Mon f b -> Mon f b #

(<*) :: Mon f a -> Mon f b -> Mon f a #

(Monad f, Reducer c m) => Reducer (f c) (Mon f m) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

unit :: f c -> Mon f m Source #

snoc :: Mon f m -> f c -> Mon f m Source #

cons :: f c -> Mon f m -> Mon f m Source #

(Monad f, Semigroup m) => Semigroup (Mon f m) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

(<>) :: Mon f m -> Mon f m -> Mon f m #

sconcat :: NonEmpty (Mon f m) -> Mon f m #

stimes :: Integral b => b -> Mon f m -> Mon f m #

(Monad f, Monoid m) => Monoid (Mon f m) Source # 
Instance details

Defined in Data.Semigroup.Monad

Methods

mempty :: Mon f m #

mappend :: Mon f m -> Mon f m -> Mon f m #

mconcat :: [Mon f m] -> Mon f m #