Module

Spork.Interpreter

#Interpreter

newtype Interpreter m f i

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

Constructors

#merge

merge :: forall f g m i. 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

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

The Void interpreter.

#liftNat

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

Builds an Interpreter from a natural transformation.

#liftCont

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

Builds an Interpreter from callbacks.

#basicEffect

basicEffect :: forall i. Interpreter Effect Effect i

Runs Eff effects.

#basicAff

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

Runs Aff effects. Takes a callback for handling exceptions.

#throughAff

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

Interprets some functor f into Aff before running it.

Modules