loop now takes a required value and passes the returned non-false value into the function
This commit is contained in:
parent
44772d7e33
commit
0e60863bc5
|
@ -149,10 +149,9 @@ _itos v = error $ "itos: not an int: " ++ show v
|
|||
|
||||
_loop args@(TupleV [fn@(FnV _ _), arg]) = do
|
||||
v <- apply fn arg
|
||||
if v == BoolV True then
|
||||
_loop args
|
||||
else return UnitV
|
||||
_loop fn@(FnV _ _) = _loop $ TupleV [fn, UnitV]
|
||||
if v /= BoolV False then
|
||||
_loop $ TupleV [fn, v]
|
||||
else return v
|
||||
|
||||
initialState = ([stdout, stdin],
|
||||
[M.fromList [("id", FnV emptyEnv [(VarP "x", Var "x")]),
|
||||
|
|
Loading…
Reference in New Issue