blob: 7849980a5337414e0d95bcc1f879e0ce72bfbc6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// Church booleans
var True = t => f => t;
var False = t => f => f;
var bool_to_str = b => b("True")("False");
var And = a => b => a(b)(a);
var Or = a => b => a(a)(b);
assertEq(And(True)(True), True);
assertEq(And(True)(False), False);
assertEq(And(False)(True), False);
assertEq(And(False)(False), False);
assertEq(Or(True)(True), True);
assertEq(Or(True)(False), True);
assertEq(Or(False)(True), True);
assertEq(Or(False)(False), False);
|