package yuujinchou
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=9f9ffab321f221b01a17da07ae3b337b
sha512=7422c9e2f56efe65a8a063679665b2d3ada04e6354ce2e145bada04a90d41852aa07c2bde8c602505ff3ce6ae69607a0d7573439c289810fdf22cea888713623
doc/yuujinchou/Yuujinchou/Language/index.html
Module Yuujinchou.Language
Source
The Language
module defines the language of modifiers.
Types
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
.
Modifier Builders
Basics
only path
keeps the subtree rooted at path
. It is an error if the subtree was empty.
Negation
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
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).
Sequencing
seq [m0; m1; m2; ...; mn]
runs the modifiers m0
, m1
, m2
, ..., mn
in order. In particular, seq []
is the identity modifier.
Union
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.
Custom Hooks
hook h
applies the hook labelled h
to the entire trie by performing the Modifier.handler.hook
effect.
Ugly Printing
dump dump_hook m
dumps the internal representation of m
for debugging, where dump_hook
is the ugly printer for hook labels (see hook
).