-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Horizontally composable effects -- -- This library provides for the horizontal composition of effects, -- serving as an alternative to the monad transformers stacking -- composition. It is expected to be faster, but no comparison has been -- performed yet. @package fx @version 0.7 module Fx.Executor -- | An abstraction over the execution of effect in -- context, both producing the same result. newtype Executor effect context Executor :: (forall result. effect result -> context result) -> Executor effect context -- | Map the effect part of an executor (contravariantly). mapEffect :: (forall result. newEffect result -> oldEffect result) -> Executor oldEffect context -> Executor newEffect context -- | Map the context part of an executor. mapContext :: (forall result. oldContext result -> newContext result) -> Executor effect oldContext -> Executor effect newContext -- | Use the executor to run an effect in a context. execute :: Executor effect context -> effect result -> context result module Fx.EitherEffect -- | A sum of two effects (effect1 and effect2) to be -- executed in context producing result. data EitherEffect effect1 effect2 context result -- | Lift the first of the two effects. liftEffect1 :: effect1 result -> EitherEffect effect1 effect2 context result -- | Lift the second of the two effects. liftEffect2 :: effect2 result -> EitherEffect effect1 effect2 context result -- | Compose the executors of each effect into an executor of either. executor :: Executor effect1 context -> Executor effect2 context -> Executor (EitherEffect effect1 effect2 context) context instance Control.Monad.IO.Class.MonadIO context => Control.Monad.IO.Class.MonadIO (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance GHC.Base.MonadPlus context => GHC.Base.MonadPlus (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance GHC.Base.Monad context => GHC.Base.Monad (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance GHC.Base.Alternative context => GHC.Base.Alternative (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance GHC.Base.Applicative context => GHC.Base.Applicative (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance GHC.Base.Functor context => GHC.Base.Functor (Fx.EitherEffect.EitherEffect effect1 effect2 context) instance Control.Monad.Trans.Class.MonadTrans (Fx.EitherEffect.EitherEffect effect1 effect2)