Safe Haskell | Safe |
---|---|
Language | GHC2021 |
LambdaUC.Syntax.Async.SomeWT
Synopsis
- data ContFromAnyWT ach bef aft a b = 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
- dispatchSomeWT :: ContFromAnyWT ach bef aft a b -> (forall i. KnownIndex i => a -> AsyncT ach i aft b) -> AsyncT ach bef aft b
Documentation
data ContFromAnyWT ach bef aft a b #
A computation that
- Starts in Write Token state
bef
, - stops in Write Token state
i
with resulta
, - runs the continuation given as first argument from there to finish in Write Token state
aft
with resultb
.
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.