Effect.Deep(3)
π Effect.Deep(3) β the OCaml library page, bestie β¨
okay so this is the manpage for Effect.Deep, from the OCaml library, and it is highkey all about deep handlers. continuations, handlers, effects β iykyk. π¦
πΈ NAME
Effect.Deep β and the manual literally says no description. That's the whole NAME section. iconic minimalist behavior, honestly. π
π¦ Module
Module Effect.Deep
β¨ Documentation
π§ Module Deep
Module Deep
: sig end
π Deep handlers
okay bestie, deep handlers are the main character here. let's go. π
type ('a, 'b) continuation = ('a, 'b) continuation
('a,'b) continuation is a delimited continuation that expects a 'a value and returns a 'b value.
val continue : ('a, 'b) continuation -> 'a -> 'b
continue k x resumes the continuation k by passing x to k.
Raises Continuation_already_resumed if the continuation has already been resumed. π
val discontinue : ('a, 'b) continuation -> exn -> 'b
discontinue k e resumes the continuation k by raising the exception e in k.
Raises Continuation_already_resumed if the continuation has already been resumed. π
val discontinue_with_backtrace : ('a, 'b) continuation -> exn ->
Printexc.raw_backtrace -> 'b
discontinue_with_backtrace k e bt resumes the continuation k by raising the exception e in k using bt as the origin for the exception.
Raises Continuation_already_resumed if the continuation has already been resumed. π
type ('a, 'b) handler = {
retc : 'a -> 'b ;
exnc : exn -> 'b ;
effc : 'c. 'c Effect.t -> (('c, 'b) 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. this record ate and left no crumbs. π
val match_with : ('c -> 'a) -> 'c -> ('a, 'b) handler -> 'b
match_with f v h runs the computation f v in the handler h.
type 'a effect_handler = {
effc : 'b. 'b Effect.t -> (('b, 'a) 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 effect_handler -> 'a
try_with f v h runs the computation f v under the handler h.
val get_callstack : ('a, 'b) continuation -> int ->
Printexc.raw_backtrace
get_callstack c n returns a description of the top of the call stack on the continuation c, with at most n entries.
xoxo bestie, that's the whole Effect.Deep(3) page π β OCamldoc Β· 2026-06-22 β¨ periodt.
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms