extensible-0.3.5: Extensible, efficient, lens-friendly data types

Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Effect

Contents

Synopsis

Documentation

data Instruction xs a where Source

A unit of effects

Constructors

Instruction :: !(Membership xs kv) -> AssocValue kv a -> Instruction xs a 

type Eff xs = Skeleton (Instruction xs) Source

The extensible operational monad

liftEff :: forall proxy s t xs a. Associate s t xs => proxy s -> t a -> Eff xs a Source

Lift some effect to Eff

hoistEff :: forall proxy s t xs a. Associate s t xs => proxy s -> (forall x. t x -> t x) -> Eff xs a -> Eff xs a Source

handleWith :: RecordOf (Handler m) xs -> Eff xs a -> MonadView m (Eff xs) a Source

newtype Handler f g Source

Transformation between effects

Constructors

Handler 

Fields

runHandler :: forall a. g a -> f a
 

Unnamed actions

data Action args a r where Source

Unnamed action

Constructors

AResult :: Action [] a a 
AArgument :: x -> Action xs a r -> Action (x : xs) a r 

type family Function args r :: * Source

Equations

Function [] r = r 
Function (x : xs) r = x -> Function xs r 

receive :: Functor f => Function xs (f a) -> Handler f (Action xs a) Source