monad-skeleton-0.2: Monads of program skeleta
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Zombie

Synopsis

Documentation

data Zombie t a where Source #

Zombie is a variant of Skeleton which has an Alternative instance.

Constructors

Sunlight :: Zombie t a 
ReturnZ :: a -> Zombie t a -> Zombie t a 
BindZ :: t x -> Cat (Kleisli (Zombie t)) x a -> Zombie t a -> Zombie t a 

Instances

Instances details
Alternative (Zombie t) Source # 
Instance details

Defined in Control.Monad.Zombie

Methods

empty :: Zombie t a #

(<|>) :: Zombie t a -> Zombie t a -> Zombie t a #

some :: Zombie t a -> Zombie t [a] #

many :: Zombie t a -> Zombie t [a] #

Applicative (Zombie t) Source # 
Instance details

Defined in Control.Monad.Zombie

Methods

pure :: a -> Zombie t a #

(<*>) :: Zombie t (a -> b) -> Zombie t a -> Zombie t b #

liftA2 :: (a -> b -> c) -> Zombie t a -> Zombie t b -> Zombie t c #

(*>) :: Zombie t a -> Zombie t b -> Zombie t b #

(<*) :: Zombie t a -> Zombie t b -> Zombie t a #

Functor (Zombie t) Source # 
Instance details

Defined in Control.Monad.Zombie

Methods

fmap :: (a -> b) -> Zombie t a -> Zombie t b #

(<$) :: a -> Zombie t b -> Zombie t a #

Monad (Zombie t) Source # 
Instance details

Defined in Control.Monad.Zombie

Methods

(>>=) :: Zombie t a -> (a -> Zombie t b) -> Zombie t b #

(>>) :: Zombie t a -> Zombie t b -> Zombie t b #

return :: a -> Zombie t a #

MonadPlus (Zombie t) Source # 
Instance details

Defined in Control.Monad.Zombie

Methods

mzero :: Zombie t a #

mplus :: Zombie t a -> Zombie t a -> Zombie t a #

liftZ :: t a -> Zombie t a Source #

Lift a unit action

embalm :: MonadView t (Zombie t) a -> Zombie t a Source #

Turn a decomposed form into a composed form.

disembalm :: Zombie t a -> [MonadView t (Zombie t) a] Source #

Decompose a zombie as a list of possibilities.

disembalmBy :: r -> (MonadView t (Zombie t) a -> r -> r) -> Zombie t a -> r Source #

Decompose a zombie as a list of possibilitie and fold the list.

hoistZombie :: forall s t a. (forall x. s x -> t x) -> Zombie s a -> Zombie t a Source #