package multicont

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type ('a, 'b) resumption

a resumption is a managed variation of Effect.Deep.continuation that can be used multiple times.

val promote : ('a, 'b) Stdlib.Effect.Deep.continuation -> ('a, 'b) resumption

promote k converts a regular linear deep continuation to a multi-shot deep resumption. This function fully consumes the supplied the continuation k.

val resume : ('a, 'b) resumption -> 'a -> 'b

resume r v reinstates the context captured by the multi-shot deep resumption r with value v.

val abort : ('a, 'b) resumption -> exn -> 'b

abort r e injects the exception e into the context captured by the multi-shot deep resumption r.

val abort_with_backtrace : ('a, 'b) resumption -> exn -> Stdlib.Printexc.raw_backtrace -> 'b

abort_with_backtrace k e bt aborts the deep multi-shot resumption r by raising the exception e in k using bt as the origin for the exception.

val clone_continuation : ('a, 'b) Stdlib.Effect.Deep.continuation -> ('a, 'b) Stdlib.Effect.Deep.continuation

clone_continuation k clones the linear deep continuation k. The supplied continuation is *not* consumed.

val drop_continuation : ('a, 'b) Stdlib.Effect.Deep.continuation -> unit

drop_continuation k deallocates the memory occupied by the continuation k. Note, however, that this function does not clean up acquired resources captured by the continuation. In order to delete the continuation and free up the resources the programmer should instead use `discontinue` from the Effect.Deep module.