Skip to main content

occurrence_count_in_term

Function occurrence_count_in_term 

Source
pub fn occurrence_count_in_term(body: &Term, name: &str) -> u32
Expand description

How many FREE occurrences of name a Term has, saturating at u32::MAX.

ITERATIVE, so it answers about a term too deep for the native stack. type_checker::body_stats computes the same number by native recursion and therefore has a ceiling of its own; the unit tests at the bottom of this file pin the two against each other on every shape, so they can never drift.