/// Abstracts a type over all type variables which are free in the type
/// but not free in the given typing context.
///
/// I.e. returns the canonical polymorphic type.
Abstracts a type over all type variables which are free in the type
but not free in the given typing context.


Abstracts a type over all type variables which are free in the type but not free in the given typing context .
pub fn generalize(&self, ast_type: Type) -> Scheme {
        // NOTE `self.difference(other)` == the values that are in self but not in other.
        let forall = type_variables(&ast_type)
            .difference(&self.free_type_variables())
            .copied()
            .collect();
        Scheme {
            forall,
            signature: ast_type,
        }
    }
pub fn generalize ( & self , ast_type : Type ) -> Scheme { // NOTE `self.difference(other)` == the values that are in self but not in other. let forall = type_variables ( & ast_type ) . difference ( & self . free_type_variables ( ) ) . copied ( ) . collect ( ) ; Scheme { forall , signature : ast_type , } }
Abstracts a type over all type variables which are free in the type
but not free in the given typing context.
Abstracts a type over all type variables which are free in the type but not free in the given typing context .
&self
ast_type
Type