u
[cc1516.git] / sem.icl
diff --git a/sem.icl b/sem.icl
index 68b804d..2341eef 100644 (file)
--- a/sem.icl
+++ b/sem.icl
@@ -26,7 +26,6 @@ from Text import class Text(concat), instance Text String
 
 import AST
 
-
 :: Scheme = Forall [TVar] Type
 :: Gamma :== 'Map'.Map String Scheme //map from Variables! to types
 :: Typing a :== StateT (Gamma, [TVar]) (Either SemError) a
@@ -173,6 +172,7 @@ generalize :: Type -> Typing Scheme
 generalize t = gamma >>= \g-> pure $ Forall (difference (ftv t) (ftv g)) t
 
 lookup :: String -> Typing Type 
+lookup "isEmpty" = ListType <$> fresh
 lookup k = gamma >>= \g-> case 'Map'.member k g of
     False = liftT (Left $ UndeclaredVariableError zero k)
     True = instantiate $ 'Map'.find k g