pub fn build_polytype(from: PolyTypeMap, sub: &mut Substitution) -> Result<PolyType> {
    let (r, cons) = build_record(from, sub);
    infer::solve(&cons, sub)?;
    let typ = MonoType::record(r).apply(sub);
    Ok(infer::generalize(
        &Environment::empty(false),
        sub.cons(),
        typ,
    ))
}
/// Constructs a polytype, or more specifically a generic record type, from a hash map.
Constructs a polytype, or more specifically a generic record type, from a hash map.
Constructs a polytype or more specifically a generic record type from a hash map .
pub fn build_polytype(from: PolyTypeMap, sub: &mut Substitution) -> Result<PolyType> {
    let (r, cons) = build_record(from, sub);
    infer::solve(&cons, sub)?;
    let typ = MonoType::record(r).apply(sub);
    Ok(infer::generalize(
        &Environment::empty(false),
        sub.cons(),
        typ,
    ))
}
pub fn build_polytype ( from : PolyTypeMap , sub : & mut Substitution ) -> Result < PolyType > { let ( r , cons ) = build_record ( from , sub ) ; infer :: solve ( & cons , sub ) ? ; let typ = MonoType :: record ( r ) . apply ( sub ) ; Ok ( infer :: generalize ( & Environment :: empty ( false ) , sub . cons ( ) , typ , ) ) }
Constructs a polytype, or more specifically a generic record type, from a hash map.
Constructs a polytype or more specifically a generic record type from a hash map .
from
PolyTypeMap
sub
&mut Substitution
from
PolyTypeMap
sub
&mut Substitution