Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created August 29, 2017 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/f6d728a9250ad2a08e8f79a474b9cbc5 to your computer and use it in GitHub Desktop.
Save ethagnawl/f6d728a9250ad2a08e8f79a474b9cbc5 to your computer and use it in GitHub Desktop.
basic boolean logic expressed in haskell
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