Expand description
Various selector functions for different use cases.
A selector function accepts an iterator over (Rule, Update) pairs and returns the
selected (Rule, Update), or None.
morph will call the given selector function when there is an ambiguity in
which rule to apply. That is, when more than one rule from the same group returns [Some(...)]
for a given sub-tree.
Functions§
- select_
first - Returns the first available (
Rule,Update) if there is one, otherwise returnsNone. - select_
panic - Panics when called by the engine, printing the original subtree and all applicable rules and their results.
- select_
random - Selects a random (
Rule,Update) from the iterator. - select_
smallest_ subtree - Selects the (
Rule,Update) which results in the smallest subtree. - select_
user_ input - Selects a (
Rule,Update) based on user input through stdin.
Type Aliases§
- Selector
Fn - A uniform type for selector functions such as
select_first.