changeset 4:783541c5ee42

Fix eval1 to 1-step style
author atton
date Wed, 26 Oct 2016 08:32:05 +0000
parents 8ab5d27e6158
children 17f5b8304641
files arith/Arith.hs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/arith/Arith.hs	Wed Oct 26 08:19:46 2016 +0000
+++ b/arith/Arith.hs	Wed Oct 26 08:32:05 2016 +0000
@@ -30,7 +30,7 @@
 eval1 :: Term -> Either String Term
 eval1 (TmIf TmTrue  t _)    = return t
 eval1 (TmIf TmFalse _ f)    = return f
-eval1 (TmIf con t f)        = eval1 t >>= (\con' -> eval1 (TmIf con' t f))
+eval1 (TmIf con t f)        = eval1 con >>= (\con' -> return (TmIf con' t f))
 eval1 (TmSucc t)            = eval1 t >>= (\t' -> return $ TmSucc t')
 eval1 (TmPred TmZero)       = return $ TmZero
 eval1 (TmPred (TmSucc t))