Created
November 23, 2013 10:15
-
-
Save yingtai/7612918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Eval (eval) | |
results = [eval "(\\x. x) (\\x. x)" == "(\\ 0)", | |
eval "(\\x. x x) (\\x. \\y. x)" == "(\\ (\\ (\\ 1)))", | |
eval "(\\p. p (\\t. \\f. t)) ((\\f. \\s. \\b. b f s) (\\x. x) (\\x. \\y. x))" == "(\\ 0)", | |
eval "(\\x. \\y. \\z. x z (y z)) (\\x. \\y. x) (\\x. \\y. x) (\\x. \\y. x)" == "(\\ (\\ 1))", | |
eval "(\\m. m (\\x. \\t. \\f. f) (\\t. \\f. t)) ((\\n. \\s. \\z. s (n s z)) (\\s. \\z. s z))" == "(\\ (\\ 0))"] | |
main = do | |
let xs = filter (not . snd) $ zip [0..] results :: [(Int, Bool)] | |
if null xs then putStrLn "OK" | |
else putStrLn $ "Failed in No." ++ (show $ fst $ head xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment