aboutsummaryrefslogtreecommitdiff
path: root/hw06/hw06_combinators.scm
diff options
context:
space:
mode:
Diffstat (limited to 'hw06/hw06_combinators.scm')
-rw-r--r--hw06/hw06_combinators.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/hw06/hw06_combinators.scm b/hw06/hw06_combinators.scm
new file mode 100644
index 0000000..0c3fdaf
--- /dev/null
+++ b/hw06/hw06_combinators.scm
@@ -0,0 +1,21 @@
+#lang eopl
+
+; Ben Burwell
+; Dr. Kussmaul
+; CSI-310 Programming Languages
+; HW06 :: Combinators
+
+; A. evaluate boolean logic expression
+(or F (and T (not F)))
+(or F (and T T))
+(or F T)
+T
+
+; B. compute 2+1 using Church numerals
+(increment 2)
+
+((λ (n) (λ (f) (λ (x) (f ((n f) x))))) (λ (f) (λ (x) (f (f x)))))
+( λ (f) (λ (x) (f (((λ (f) (λ (x) (f (f x)))) f) x))))
+( λ (f) (λ (x) (f ( (λ (x) (f (f x))) x))))
+( λ (f) (λ (x) (f (f (f x)))))
+(λ (f) (λ (x) (f (f (f x))))) \ No newline at end of file