From 65c47c20fc8c4005e12dac447d0f394303ef5213 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 7 Nov 2018 17:01:07 -0800 Subject: [PATCH] Change name of monad in which type inference happens --- schala-lang/language/src/typechecking.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index bf6a56a..834601f 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -8,7 +8,7 @@ pub struct TypeContext { } -type TypeResult = Result; +type InferResult = Result; #[derive(Debug, Clone)] struct TypeError { } @@ -56,7 +56,7 @@ impl TypeContext { } impl TypeContext { - fn infer_ast(&mut self, ast: &AST) -> TypeResult { + fn infer_ast(&mut self, ast: &AST) -> InferResult { let mut output = MonoType::Const(TConst::Unit); for statement in ast.0.iter() { output = match statement { @@ -67,18 +67,18 @@ impl TypeContext { Ok(output) } - fn infer_expr(&mut self, expr: &Expression) -> TypeResult { + fn infer_expr(&mut self, expr: &Expression) -> InferResult { match expr { Expression(expr_type, Some(type_anno)) => unimplemented!(), Expression(expr_type, None) => self.infer_expr_type(expr_type) } } - fn infer_decl(&mut self, expr: &Declaration) -> TypeResult { + fn infer_decl(&mut self, expr: &Declaration) -> InferResult { Ok(MonoType::Const(TConst::user("unimplemented"))) } - fn infer_expr_type(&mut self, expr_type: &ExpressionType) -> TypeResult { + fn infer_expr_type(&mut self, expr_type: &ExpressionType) -> InferResult { use self::ExpressionType::*; match expr_type { NatLiteral(_) => Ok(MonoType::Const(TConst::Nat)),