repositories
/
cc1516.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43f59bf
)
Added op1Type function
author
pimjager
<pim@pimjager.nl>
Fri, 22 Apr 2016 11:21:05 +0000
(13:21 +0200)
committer
pimjager
<pim@pimjager.nl>
Fri, 22 Apr 2016 11:21:05 +0000
(13:21 +0200)
sem.icl
patch
|
blob
|
history
diff --git
a/sem.icl
b/sem.icl
index
77e6554
..
024d7fe
100644
(file)
--- 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