Expand description
Various selector functions for different use cases.
A selector function accepts an iterator over (Rule, Update) pairs and returns the
selected 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
Updateif 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
Updatefrom the iterator. - select_
smallest_ subtree - Selects the
Updatewhich results in the smallest subtree. - select_
user_ input - Selects an
Updatebased on user input through stdin.
Type Aliases§
- Selector
Fn - A uniform type for selector functions such as
select_first.