From 89c18a3f0b801db7b10039bc8b9fea7b21ff1d71 Mon Sep 17 00:00:00 2001 From: pimjager Date: Fri, 22 Apr 2016 13:21:05 +0200 Subject: [PATCH] Added op1Type function --- sem.icl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sem.icl b/sem.icl index 77e6554..024d7fe 100644 --- a/sem.icl +++ b/sem.icl @@ -76,6 +76,10 @@ op2Type op | elem op [BiPlus, BiMinus, BiTimes, BiDivide, BiMod] | op == BiCons = fresh >>= \t1-> pure (t1 ->> ListType t1 ->> ListType t1) +op1Type :: Op1 -> Infer Type +op1Type UnNegation = pure $ (BoolType ->> BoolType) +op1Type UnMinus = pure $ (IntType ->> IntType) + instance infer Expr where infer (VarExpr _ vd) = undef infer (Op2Expr _ e1 op e2) = case op of -- 2.20.1