Page
Library
Module
Module type
Parameter
Class
Class type
Source
Yuujinchou.ActionSourceThe Action module implements the engine running the patterns.
The engine tries to preserve physical equality whenever feasible. For example, if the trie t has a binding at x, the pattern Pattern.renaming["x"] ["x"] on t will return the original t.
type nonrec ('a, 'error) result =
('a Trie.t, [> `BindingNotFound of Pattern.path ] as 'error) resultThe type of the result. The error `BindingNotFound means that the engine expected at least one binding under path but could not find it.
val run :
?rev_prefix:Pattern.path ->
union:(rev_path:Pattern.path -> 'a -> 'a -> 'a) ->
unit Pattern.t ->
'a Trie.t ->
('a, 'error) resultrun ~rev_prefix ~union pattern trie runs the pattern on the trie and return the transformed trie. It ignores patterns created by Pattern.hook.
val run_with_hooks :
?rev_prefix:Pattern.path ->
union:(rev_path:Pattern.path -> 'a -> 'a -> 'a) ->
hooks:('hook -> rev_prefix:Pattern.path -> 'a Trie.t -> ('a, 'error) result) ->
'hook Pattern.t ->
'a Trie.t ->
('a, 'error) resultrun_with_hooks ~rev_prefix ~hooks ~union pattern trie runs the pattern on the trie and return the transformed trie. It is similar to run but accepts a new argument hooks to handle the patterns created by Pattern.hook.
Pretty printer for path.