Module usefulness

Source

Structsยง

Matrix ๐Ÿ”’
A vector of patterns which generally make up a set of patterns for which to check usefulness against. All patterns in the matrix must be of equal length
PatStack ๐Ÿ”’
Usefulness ๐Ÿ”’
Struct representing if a pattern is useful nor not. witnesses are a list of patterns which are not matched. Not guaranteed to list all patterns, but is guaranteed to list at least one witness if the pattern is useful
Witness
A witness of the usefulness of a pattern. During construction, patterns are pushed from left to right, with constructors containing fields โ€œconsumingโ€ fields already on the stack for its parameters

Functionsยง

is_useful ๐Ÿ”’
Checks if pattern is useful with respect to prev_patterns, that is, if the pattern matches some value which is not matched by any pattern in prev_patterns