package yuujinchou

  1. Overview
  2. Docs

Parameters

module H : Handler

Signature

val run : (unit -> 'a) -> 'a

run f h initializes the engine and runs the thunk f, using h to handle modifier effects. See Handler.

val try_with : (unit -> 'a) -> 'a

try_with f h runs the thunk f, using h to handle the intercepted modifier effects. See Handler.

Currently, try_with is an alias of run, but try_with is intended to use within run to intercept effects, while run is intended to be at the outermost layer to handle effects. That is, the following is the expected program structure:

run @@ fun () ->
(* code *)
try_with f
(* more code *)
OCaml

Innovation. Community. Security.