strictness, ci
[minfp.git] / int.icl
diff --git a/int.icl b/int.icl
index 0fb8087..f096200 100644 (file)
--- a/int.icl
+++ b/int.icl
@@ -15,7 +15,7 @@ import ast
 
 :: Eval a :== StateT [([Char], Value)] (Either [String]) a
 
-int :: Expression -> Either [String] Value
+int :: !Expression -> Either [String] Value
 int e = evalStateT (eval e)
        [(['_if'], Builtin \i->pure (Lit (Builtin \t->pure (Lit (Builtin \e->
                eval i >>= \(Bool b)->pure (if b t e))))))
@@ -24,8 +24,6 @@ int e = evalStateT (eval e)
        ,(['_add'], binop \(Int i) (Int j)->Int  (i + j))
        ,(['_mul'], binop \(Int i) (Int j)->Int  (i * j))
        ,(['_div'], binop \(Int i) (Int j)->Int  (i / j))
-       ,(['_fst'], Builtin \t->eval t >>= \(a ** b)->pure a)
-       ,(['_snd'], Builtin \t->eval t >>= \(a ** b)->pure b)
        ]
 where
        binop :: (Value Value -> Value) -> Value
@@ -36,7 +34,6 @@ eval (Let ns rest) = sequence [eval v >>= \v->modify (\vs->[(n, v):vs])\\(n, v)<
 eval (Lit v) = pure v
 eval (Var v) = gets (lookup v) >>= maybe (liftT (Left [toString v +++ " not found"])) pure
 eval (Lambda a b) = pure (Lambda` a b)
-eval (Tuple a b) = pure (a ** b)
 eval (App e1 e2) = eval e1 >>= \v->case v of
        (Lambda` v b) = eval (sub v e2 b)
        (Builtin f) = f e2 >>= eval