i realise i don't comment enough
This commit is contained in:
@@ -267,6 +267,7 @@ step st =
|
|||||||
|
|
||||||
primStep _ IfP (TiState s d h g sts) = TiState s' d' h' g sts
|
primStep _ IfP (TiState s d h g sts) = TiState s' d' h' g sts
|
||||||
where
|
where
|
||||||
|
-- the condition is evaluated if it is not in normal form
|
||||||
s' | needsEval cn = [c]
|
s' | needsEval cn = [c]
|
||||||
| otherwise = drop 3 s
|
| otherwise = drop 3 s
|
||||||
|
|
||||||
@@ -281,6 +282,8 @@ step st =
|
|||||||
[c,t,f] = getArgs h s
|
[c,t,f] = getArgs h s
|
||||||
rootAddr = head s'
|
rootAddr = head s'
|
||||||
isTrue = case cn of
|
isTrue = case cn of
|
||||||
|
-- see Core.Examples.corePrelude; True and False are defined
|
||||||
|
-- as Con 1 0 and Con 0 0, respectively
|
||||||
NData 0 [] -> False
|
NData 0 [] -> False
|
||||||
NData 1 [] -> True
|
NData 1 [] -> True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user