A pattern is a predicate on lists.
interface pattern[contravariant readonly value element type]
extends predicate[readonly list[element type]]
Check whether the given list can be a start of the sequence that matches this pattern.
boolean is viable prefix(readonly list[element type] the list)
Returns the maximum number of the elements of a given list that matches the pattern, or null if there is no prefix match. This is a greedy match: it mtaches the longest prefix.
nonnegative or null match prefix(readonly list[element type] the list)
Gets the first non-empty match for this pattern.
range or null find first(readonly list[element type] the list, nonnegative start index)
immutable list[immutable list[element type]] split(immutable list[element type] the list)