event-transformer-0.1.0.0: Initial project template from stack

Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Trans.Event

Synopsis

Documentation

newtype EventT m b Source #

The EventT type is an effectful Moore machine with a possible end result.

Constructors

EventT 

Fields

Instances

MonadTrans EventT Source # 

Methods

lift :: Monad m => m a -> EventT m a #

Monad m => Monad (EventT m) Source #

EventT is a Monad by running an evented computation until it ends, then uses the end result as the input to the next evented computation.

Methods

(>>=) :: EventT m a -> (a -> EventT m b) -> EventT m b #

(>>) :: EventT m a -> EventT m b -> EventT m b #

return :: a -> EventT m a #

fail :: String -> EventT m a #

Monad m => Functor (EventT m) Source #

EventT is a Functor by applying the given function to its end result.

Methods

fmap :: (a -> b) -> EventT m a -> EventT m b #

(<$) :: a -> EventT m b -> EventT m a #

Monad m => Applicative (EventT m) Source #

EventT is an Applicative by responding to pure by immediately terminating with the argument as its end result. EventT responds to apply by running both left and right computations in serial until they have concluded, then applies the left result to the right result.

Methods

pure :: a -> EventT m a #

(<*>) :: EventT m (a -> b) -> EventT m a -> EventT m b #

(*>) :: EventT m a -> EventT m b -> EventT m b #

(<*) :: EventT m a -> EventT m b -> EventT m a #

MonadIO m => MonadIO (EventT m) Source # 

Methods

liftIO :: IO a -> EventT m a #

done :: Monad m => a -> EventT m a Source #

Ends the computation this frame and yields a concrete result.

next :: Monad m => EventT m a -> EventT m a Source #

Ends the computation this frame and yields a continuation to run next frame.

wait :: Monad m => Int -> EventT m () Source #

Waits a number of frames.

withEither :: Monad m => EventT m a -> EventT m b -> EventT m (Either a b) Source #

Runs both evented computations (left and then right) each frame and returns the first computation that completes.

withAny :: Monad m => [EventT m a] -> EventT m a Source #

Runs all evented computations (left to right) on each frame and returns the first computation that completes.