Module

Spork.Interpreter

Package
purescript-spork
Repository
natefaubion/purescript-spork

#Interpreter Source

newtype Interpreter m f i

An Interpreter takes inputs embedded in some functor f and pushes them out with effects m.

Constructors

#merge Source

merge :: forall i m g f. Applicative m => Interpreter m f i -> Interpreter m g i -> Interpreter m (Coproduct f g) i

Funnels two Interpreters into one by taking the Coproduct.

#never Source

never :: forall i m. Monad m => Interpreter m (Const Void) i

The Void interpreter.

#liftNat Source

liftNat :: forall i m f. Monad m => (f ~> m) -> Interpreter m f i

Builds an Interpreter from a natural transformation.

#liftCont Source

liftCont :: forall i m f. Applicative m => (forall j. (j -> m Unit) -> f j -> m Unit) -> Interpreter m f i

Builds an Interpreter from callbacks.

#basicEff Source

basicEff :: forall i eff. Interpreter (Eff eff) (Eff eff) i

Runs Eff effects.

#basicAff Source

basicAff :: forall i eff. (Error -> Eff eff Unit) -> Interpreter (Eff eff) (Aff eff) i

Runs Aff effects. Takes a callback for handling exceptions.

#throughAff Source

throughAff :: forall i f eff. (f ~> (Aff eff)) -> (Error -> Eff eff Unit) -> Interpreter (Eff eff) f i

Interprets some functor f into Aff before running it.