bound-extras-0: ScopeH and ScopeT extras for bound

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Module

Description

Right monad Module type-class.

Most possible instances are omitted. The primary use-case for Module is to power ScopeH.

Synopsis

Documentation

class (Functor f, Monad m) => Module f m where Source #

f is right m-module. (according to https://ncatlab.org/nlab/show/module+over+a+monad#modules definitions). We have Compose f m ~> f natural transformation.

Laws

fma >>== return    = fma
fma >>== (f >=> g) = (fma >>== f) >>== g

Properties

For all Monad m we can write associated instance Module m m where (>>==) = (>>=).

mjoin and >>== are equivalent in power:

fa >>== amb = mjoin (fmap amb fa)

Minimal complete definition

(>>==)

Methods

(>>==) :: f a -> (a -> m b) -> f b infixl 1 Source #

Called action.

Instances
Monad m => Module m Identity Source # 
Instance details

Defined in Control.Monad.Module

Methods

(>>==) :: m a -> (a -> Identity b) -> m b Source #

Monad m => Module (Scope b m) m Source # 
Instance details

Defined in Control.Monad.Module

Methods

(>>==) :: Scope b m a -> (a -> m b0) -> Scope b m b0 Source #

(Monad f, Functor (t f)) => Module (ScopeT b t f) f Source # 
Instance details

Defined in Bound.ScopeT

Methods

(>>==) :: ScopeT b t f a -> (a -> f b0) -> ScopeT b t f b0 Source #

(Functor f, Monad m) => Module (ScopeH b f m) m Source # 
Instance details

Defined in Bound.ScopeH

Methods

(>>==) :: ScopeH b f m a -> (a -> m b0) -> ScopeH b f m b0 Source #

mjoin :: Module f m => f (m a) -> f a Source #

Module's join variant.

transAction :: (MonadTrans t, Monad m, Monad (t m)) => t m a -> (a -> m b) -> t m b Source #

Module m (t m) action's implementation.

composeAction :: (Functor f, Monad m) => Compose f m a -> (a -> m b) -> Compose f m b Source #

Module m (Compose f m) action's implementation.