Library
Module
Module type
Parameter
Class
Class type
The Language
module defines the language of modifiers.
The abstract type of modifiers, parametrized by the type of hook labels. See hook
for hook labels.
Construct terms using builders in Language
and execute them using Modifier.S.modify
.
val any : 'hook t
only path
keeps the subtree rooted at path
. It is an error if the subtree was empty.
val none : 'hook t
none
drops everything. It is an error if the tree was already empty (nothing to drop). To avid the emptiness checking, use the empty modifier union
[]
.
renaming path path'
relocates the subtree rooted at path
to path'
. The existing bindings at path'
(if any) will be dropped. It is an error if the subtree was empty (nothing to move).
seq [m0; m1; m2; ...; mn]
runs the modifiers m0
, m1
, m2
, ..., mn
in order. In particular, seq []
is the identity modifier.
union [m0; m1; m2; ...; mn]
calculates the union of the results of individual modifiers m0
, m1
, m2
, ..., mn
. In particular, union []
is the empty modifier. The Modifier.handler.shadow
effect will be performed to resolve name conflicts, with an intention for results of a modifier to shadow those of previous ones.
val hook : 'hook -> 'hook t
hook h
applies the hook labelled h
to the entire trie by performing the Modifier.handler.hook
effect.
val dump :
(Format.formatter -> 'hook -> unit) ->
Format.formatter ->
'hook t ->
unit
dump dump_hook m
dumps the internal representation of m
for debugging, where dump_hook
is the ugly printer for hook labels (see hook
).