lambda-uc-0.1.0.0
Safe HaskellSafe
LanguageGHC2021

LambdaUC.Syntax.Async.SomeWT

Synopsis

Documentation

data ContFromAnyWT ach bef aft a b #

A computation that

  1. Starts in Write Token state bef,
  2. stops in Write Token state i with result a,
  3. runs the continuation given as first argument from there to finish in Write Token state aft with result b.

Constructors

ContFromAnyWT ((forall i. KnownIndex i => a -> AsyncT ach i aft b) -> AsyncT ach bef aft b) 

type SomeWT ach bef a = forall aft b. ContFromAnyWT ach bef aft a b #

A version of ContFromAnyWT that hides aft and b under quantifiers.

Use this if you want to define interactive computations that stop in Write Token state of its choosing.

dispatchSomeWT :: ContFromAnyWT ach bef aft a b -> (forall i. KnownIndex i => a -> AsyncT ach i aft b) -> AsyncT ach bef aft b #

Given a computation that starts in Write Token state bef and stops in _some_ state of its choosing, and a way to continue from _any_ Write Token state to aft, make a computation from bef to aft.

This effectively composes two computations, taking existential quantification inside ContFromAnyWT into account.