Permalink
Browse files

Bool eliminator should be lazy!

  • Loading branch information...
1 parent ade0d93 commit 28ad59aa40a54c4118107cbafb38f37ce61ec2ca Sebastiaan Visser committed Dec 20, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Lang/JavaScript.hs
View
@@ -27,7 +27,7 @@ instance FunC (Val JavaScript) where
instance BoolC (Val JavaScript) where
true = Con "true"
false = Con "false"
- bool = fun3 "bool" (\t e b -> b ++ " ? " ++ t ++ " : " ++ e)
+ bool x y z = fun3 "bool" (\t e b -> b ++ " ? " ++ t ++ "(null) : " ++ e ++ "(null)") (lam (const x)) (lam (const y)) z
instance NumC (Val JavaScript) where
(+) = fun2 "add" (\a b -> a ++ " + " ++ b)

0 comments on commit 28ad59a

Please sign in to comment.