Library
Module
Module type
Parameter
Class
Class type
The functor to generate an engine.
include Param
with type data = P.data
with type tag = P.tag
with type hook = P.hook
with type context = P.context
type data = P.data
The type of data held by the bindings. The difference between data and tags is that the data will survive the efficient retagging. See Trie.retag
.
type tag = P.tag
The type of tags attached to the bindings. The difference between data and tags is that tags can be efficiently reset. See Trie.retag
.
type hook = P.hook
The type of modifier hook labels. This is for extending the modifier language.
type context = P.context
The type of contexts passed to each call of Modifier.S.modify
for the effect handler to distinguish different function calls.
val modify :
?context:context ->
?prefix:Trie.bwd_path ->
hook Language.t ->
(data, tag) Trie.t ->
(data, tag) Trie.t
modify modifier trie
runs the modifier
on the trie
and return the transformed trie.
run f h
initializes the engine and runs the thunk f
, using h
to handle modifier effects. See handler
.
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 *)