pub fn canonical_alias<'t, F, T>(
    env: &(dyn TypeEnv<Type = T> + '_),
    interner: &mut impl TypeContext<Symbol, T>,
    typ: &'t T,
    canonical: F
) -> Cow<'t, T>
where F: FnMut(&AliasRef<Symbol, T>) -> bool, T: TypeExt<Id = Symbol, SpannedId = Symbol> + Clone + Display, T::Types: Clone + Default + Extend<T> + FromIterator<T>, T::Generics: Clone + FromIterator<Generic<Symbol>>, T::Fields: Clone,
Expand description

Resolves aliases until canonical returns true for an alias in which case it returns the type that directly contains that alias