aboutsummaryrefslogtreecommitdiff
path: root/src/simple.rs
diff options
context:
space:
mode:
authorJJ2023-07-20 10:14:55 +0000
committerJJ2023-07-20 10:21:59 +0000
commit3cf3e70cb7fcd75d53828924496699678796f5ed (patch)
tree3c4d1980cb7e8eb13017413e61eb1b15f1f2a20d /src/simple.rs
parent9672fe3861f283efc91a9cca78b17fecc5826210 (diff)
implement typeclasses as interfaces
Diffstat (limited to 'src/simple.rs')
-rw-r--r--src/simple.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simple.rs b/src/simple.rs
index e763221..c659058 100644
--- a/src/simple.rs
+++ b/src/simple.rs
@@ -6,7 +6,7 @@ impl Context {
match expression {
Expression::Annotation { expr, .. } => self.execute(*expr),
Expression::Constant { term } => Ok(term),
- Expression::Variable { id } => match self.get(&id) {
+ Expression::Variable { id } => match self.get_term(&id) {
Some(term) => Ok(term.clone()),
None => Err(format!("no such variable in context {self:?}").into())
},
@@ -16,7 +16,7 @@ impl Context {
Expression::Abstraction { param, func } => {
let value = self.execute(*arg)?;
let mut context = self.clone();
- context.insert(param, value);
+ context.insert_term(param, value);
return context.execute(*func);
}
_ => Err(format!("attempting to execute an application to non-abstraction {}", *func).into())