feat: impl ifThenElse kinda

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
This commit is contained in:
rvcas
2022-07-15 19:40:56 -04:00
committed by Kasey White
parent 83b9294ac1
commit 22f90bf07f
6 changed files with 82 additions and 25 deletions

View File

@@ -92,11 +92,20 @@ fn main() -> anyhow::Result<()> {
Program::<NamedDeBruijn>::try_from(prog)?
};
let term = program.eval()?;
let (term, cost, _logs) = program.eval();
let term: Term<Name> = term.try_into()?;
match term {
Ok(term) => {
let term: Term<Name> = term.try_into()?;
println!("{}", term.to_pretty());
println!("{}", term.to_pretty());
}
Err(err) => {
eprintln!("{}", err);
}
}
println!("Costs - memory: {} & cpu: {}", cost.mem, cost.cpu);
}
},
}