uvmhs-0.0.1.0
Safe HaskellNone
LanguageHaskell2010

UVMHS.Lib.Pipeline

Synopsis

Documentation

data Pipeline (𝒸 :: Type -> Constraint) (m :: Type -> Type) i a b where Source #

A Pipeline is essentially just a list of annotated monadic functions. Its definitions uses a GADT to capture chaining `a → m b` with `b → m c` as a Pipeline from a to c, and where b ends up existentially quantified in the chain.

A Pipeline 𝒸 m i a b` imposes constraint 𝒸 on all intermediate result types of monadic computations in the list, annotates each function in the list with a value of type i, and ultimately consumes a value of type a and produces a value of type `m b`.

Constructors

UnitPipeline :: forall (𝒸 :: Type -> Constraint) (m :: Type -> Type) i a. Pipeline 𝒸 m i a a 
StepPipeline :: forall (𝒸 :: Type -> Constraint) b1 (m :: Type -> Type) i a b. 𝒸 b1 => Pipeline 𝒸 m i a b1 -> i -> (b1 -> m b) -> Pipeline 𝒸 m i a b 

runPipeline :: forall m (𝒸 :: Type -> Constraint) i a b. Monad m => Pipeline 𝒸 m i a b -> a -> m b Source #