Effect.Shallow(3) OCaml library Effect.Shallow(3)

# [NAME](#NAME)

Effect.Shallow - no description

# [Module](#Module)

Module Effect.Shallow

# [Documentation](#Documentation)

Module **Shallow**  
: **sig end**

*type* **('a, 'b)** *continuation*

**('a,'b) continuation** is a delimited continuation that expects a **'a** value and returns a **'b** value.

*val fiber* : **('a -&gt; 'b) -&gt; ('a, 'b) continuation**

**fiber f** constructs a continuation that runs the computation **f** .

*type* **('a, 'b)** *handler* = {  
retc : **'a -&gt; 'b** ;  
exnc : **exn -&gt; 'b** ;  
effc : **'c. 'c Effect.t -&gt; (('c, 'a) continuation -&gt; '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 continue\_with* : **('c, 'a) continuation -&gt;** **'c -&gt; ('a, 'b) handler -&gt; 'b**

**continue\_with k v h** resumes the continuation **k** with value **v** with the handler **h** .

**Raises Continuation\_already\_resumed** if the continuation has already been resumed.

*val discontinue\_with* : **('c, 'a) continuation -&gt;** **exn -&gt; ('a, 'b) handler -&gt; 'b**

**discontinue\_with k e h** resumes the continuation **k** by raising the exception **e** with the handler **h** .

**Raises Continuation\_already\_resumed** if the continuation has already been resumed.

*val discontinue\_with\_backtrace* : **('a, 'b) continuation -&gt;** **exn -&gt; Printexc.raw\_backtrace -&gt; ('b, 'c) handler -&gt; 'c**

**discontinue\_with k e bt h** resumes the continuation **k** by raising the exception **e** with the handler **h** using the raw backtrace **bt** as the origin of the exception.

**Raises Continuation\_already\_resumed** if the continuation has already been resumed.

*val get\_callstack* : **('a, 'b) continuation -&gt; int -&gt; 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.

2026-10-01 OCamldoc

---

Document: Effect.Shallow(3o) from ocaml 5.5.1-r1 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
