pub fn check_module(context: &Context, items: &[Item]) -> Result<(), TypeError> {
    let mut context = context.clone();

    for item in items {
        log::trace!("checking item:\t\t{}", item.label);

        log::trace!("checking declaration:\t{}", item.term_ty);
        synth_universe(&context, &item.term_ty)?;
        let term_ty = context.eval(&item.term_ty)?;

        log::trace!("checking definition:\t{}", item.term);
        check_term(&context, &item.term, &term_ty)?;
        let value = context.eval(&item.term)?;

        log::trace!("validated item:\t\t{}", item.label);
        context.local_define(value, term_ty);
    }

    Ok(())
}
/// Check that this is a valid module.
Check that this is a valid module.
Check that this is a valid module .
pub fn check_module(context: &Context, items: &[Item]) -> Result<(), TypeError> {
    let mut context = context.clone();
    for item in items {
        log::trace!("checking item:\t\t{}", item.label);
        log::trace!("checking declaration:\t{}", item.term_ty);
        synth_universe(&context, &item.term_ty)?;
        let term_ty = context.eval(&item.term_ty)?;
        log::trace!("checking definition:\t{}", item.term);
        check_term(&context, &item.term, &term_ty)?;
        let value = context.eval(&item.term)?;
        log::trace!("validated item:\t\t{}", item.label);
        context.local_define(value, term_ty);
    }
    Ok(())
}
pub fn check_module ( context : & Context , items : & [ Item ] ) -> Result < ( ) , TypeError > { let mut context = context . clone ( ) ; for item in items { log :: trace ! ( " \t \t " item label ) ; log :: trace ! ( " \t " item term_ty ) ; synth_universe ( & context , & item . term_ty ) ? ; let term_ty = context . eval ( & item . term_ty ) ? ; log :: trace ! ( " \t " item term ) ; check_term ( & context , & item . term , & term_ty ) ? ; let value = context . eval ( & item . term ) ? ; log :: trace ! ( " \t \t " item label ) ; context . local_define ( value , term_ty ) ; } Ok ( ( ) ) }
Check that this is a valid module.
Check that this is a valid module .
context
&Context
items
&[Item]