Skip to Content
i documentation
Standard library referenceModules

i/control

One operation to pause a computation and go on with it later (§9.4).

boundary

Makes a boundary b and does body(b).

boundary : <R, E, N>((Boundary(R, E, N)) <- (Fail(E), ..N) -> R) <- (

suspend

Pauses the computation back to the boundary b, and does f(k) in the place of the boundary.

suspend : <R, E, N, A>(

escape

Ends the boundary b at once with value, as suspend(b, (k) &#123; cancel(k) value &#125;) does, but without keeping the paused computation: no frame records are made, and resource.ensure functions inside b run as for an error.

escape : <R, E, N>(Boundary(R, E, N), R) -> Never

resume

Goes on with the paused computation, with value as the value of suspend.

resume : <A, R, E, N>(Continuation(A, R, E, N), A) <- (Fail(E), ..N) -> R

cancel

Unwinds the paused computation (§9.5).

cancel : <A, R, E, N>(Continuation(A, R, E, N)) <- N -> Nil

keep_env

Keeps every service bound at this call, including services unused by f. Resume and cancel inside the returned function keep these services too.

keep_env : <S, A, E, N>((S) <- (Fail(E), ..N) -> A) <- N -> (S) <- (