Created
April 22, 2018 14:30
-
-
Save yanok/0eb3fe660634378a85d4819d1c931ff0 to your computer and use it in GitHub Desktop.
This file contains 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
data Val = VNum Double | VBool Bool | |
toNumber :: Val -> Double | |
toNumber (VNum x) = x | |
toNumber (VBool True) = 1 | |
toNumber (VBool False) = 0 | |
main :: IO () | |
main = print $ (* (-1)) $ toNumber (VBool False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment