signature MLTON_CONT = sig type 'a t val callcc: ('a t -> 'a) -> 'a val prepend: 'a t * ('b -> 'a) -> 'b t val throw: 'a t * 'a -> 'b val throw': 'a t * (unit -> 'a) -> 'b end
-
type 'a t
-
callcc f
-
prepend (k, f)
-
throw (k, v)
-
throw' (k, th)
-
the type of continuations that expect a value of type 'a.
-
applies f to the current continuation. This copies the entire stack; hence, callcc takes time proportional to the current stack size.
-
composes a function f with a continuation k to create a continuation that first does f and then does k. This is a constant time operation.
-
throws value v to continuation k. This copies the entire stack of k; hence, throw takes time proportional to the size of this stack.
-
a generalization of throw that evaluates th () in the context of k. Thus, for example, if th () raises an exception or grabs another continuation, it will see k, not the current continuation.