effect-handlers-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Free.IO

Synopsis

Documentation

This module provides a mechanism to embed IO computations into the effect monad. Note that the IO can only ever be at the base of your stack (for the same reasons as with transformers).

data LiftIO a

The functor representing the effect. You shouldn't need to create this manually, just use liftIO.

Constructors

forall r . LiftIO (IO r) (r -> a) 

Instances

liftIO :: Member LiftIO r => IO a -> Eff r a

Lift an existing IO action into the effect monad.

ioHandler :: Handler LiftIO [] a (IO a)

Handle by converting back to IO. Note that it is required that the effect stack is otherwise empty - this handler would not typecheck otherwise.