Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Stability | provisional |
Portability | GADTs, Rank2Types |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Control.Object.Mortal
Description
- newtype Mortal f g a = Mortal {}
- mortal :: Monad m => (forall x. f x -> EitherT a m (x, Mortal f m a)) -> Mortal f m a
- mortal_ :: Object f (EitherT () g) -> Mortal f g ()
- runMortal :: Monad m => Mortal f m a -> f x -> EitherT a m (x, Mortal f m a)
- immortal :: Monad m => Object f m -> Mortal f m x
- apprisesOf :: (Monad m, Monoid r) => ((Mortal f m b -> WriterT r m (Maybe (Mortal f m b))) -> s -> WriterT r m s) -> f a -> (a -> r) -> (b -> r) -> StateT s m r
- apprises :: (Witherable t, Monad m, Applicative m, Monoid r) => f a -> (a -> r) -> (b -> r) -> StateT (t (Mortal f m b)) m r
- apprise :: (Witherable t, Monad m, Applicative m) => f a -> StateT (t (Mortal f m r)) m ([a], [r])
Documentation
mortal :: Monad m => (forall x. f x -> EitherT a m (x, Mortal f m a)) -> Mortal f m a Source
Construct a mortal in a Object
construction manner.
mortal_ :: Object f (EitherT () g) -> Mortal f g () Source
Restricted Mortal
constuctor which can be applied to transit
, fromFoldable
without ambiguousness.
runMortal :: Monad m => Mortal f m a -> f x -> EitherT a m (x, Mortal f m a) Source
Send a message to a mortal.
apprisesOf :: (Monad m, Monoid r) => ((Mortal f m b -> WriterT r m (Maybe (Mortal f m b))) -> s -> WriterT r m s) -> f a -> (a -> r) -> (b -> r) -> StateT s m r Source
Send a message to mortals through a filter.
apprises :: (Witherable t, Monad m, Applicative m, Monoid r) => f a -> (a -> r) -> (b -> r) -> StateT (t (Mortal f m b)) m r Source
Send a message to mortals in a Witherable
container.
apprises = apprisesOf wither
apprise :: (Witherable t, Monad m, Applicative m) => f a -> StateT (t (Mortal f m r)) m ([a], [r]) Source
Send a message to mortals in a container.