Skip to content

Instantly share code, notes, and snippets.

@Mizzlr
Created June 16, 2016 08:57
Show Gist options
  • Select an option

  • Save Mizzlr/9c289384734310814db0b5d0cbe62332 to your computer and use it in GitHub Desktop.

Select an option

Save Mizzlr/9c289384734310814db0b5d0cbe62332 to your computer and use it in GitHub Desktop.
# The above functions in python
NULL = lambda x: x
TRUE = lambda onTrue: lambda onFalse: onTrue
FALSE = lambda onTrue: lambda onFalse: onFalse
IF = lambda test: lambda onTrue: lambda onFalse: test(onTrue)(onFalse)
AND = lambda bool1: lambda bool2: bool1(bool2)(bool1)
OR = lambda bool1: lambda bool2: bool1(bool1)(bool2)
NOT = lambda booly: booly(FALSE)(TRUE)
# Very readable and terse indeed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment