Created
August 29, 2017 15:33
-
-
Save ethagnawl/f6d728a9250ad2a08e8f79a474b9cbc5 to your computer and use it in GitHub Desktop.
basic boolean logic expressed in haskell
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
let true = \x y -> x | |
let false = \x y -> y | |
let interpret b = b "TRUE" "FALSE" | |
let and a b = a b false | |
let or a b = a true b | |
interpret true %% "TRUE" | |
interpret false %% "FALSE" | |
interpret $ and true true %% "TRUE" | |
interpret $ and false true %% "FALSE" | |
interpret $ or false true %% "TRUE" | |
interpret $ or false false %% "FALSE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment