Module Effect.Deep
Deep handlers
('a,'b) continuation is a delimited continuation that expects a 'a value and returns a 'b value.
val continue : ('a, 'b) Stdlib.Effect.Deep.continuation -> 'a -> 'bcontinue k x resumes the continuation k by passing x to k.
val discontinue : ('a, 'b) Stdlib.Effect.Deep.continuation -> exn -> 'bdiscontinue k e resumes the continuation k by raising the exception e in k.
val discontinue_with_backtrace :
('a, 'b) Stdlib.Effect.Deep.continuation ->
exn ->
Stdlib.Printexc.raw_backtrace ->
'bdiscontinue_with_backtrace k e bt resumes the continuation k by raising the exception e in k using bt as the origin for the exception.
type ('a, 'b) handler = {retc : 'a -> 'b;exnc : exn -> 'b;effc : 'c. 'c Stdlib.Effect.t -> (('c, 'b) Stdlib.Effect.Deep.continuation -> 'b) option;
}('a,'b) handler is a handler record with three fields -- retc is the value handler, exnc handles exceptions, and effc handles the effects performed by the computation enclosed by the handler.
val match_with : ('c -> 'a) -> 'c -> ('a, 'b) Stdlib.Effect.Deep.handler -> 'bmatch_with f x h runs the computation f x in the handler h.
type 'a effect_handler = {effc : 'b. 'b Stdlib.Effect.t -> (('b, 'a) Stdlib.Effect.Deep.continuation -> 'a) option;
}'a effect_handler is a deep handler with an identity value handler fun x -> x and an exception handler that raises any exception fun e -> raise e.
val try_with : ('b -> 'a) -> 'b -> 'a Stdlib.Effect.Deep.effect_handler -> 'atry_with f x h runs the computation f x under the handler h.
val get_callstack :
('a, 'b) Stdlib.Effect.Deep.continuation ->
int ->
Stdlib.Printexc.raw_backtraceget_callstack c n returns a description of the top of the call stack on the continuation c, with at most n entries.