From e1860468dc97e6249ecd19e96a2e7fffe9430d0e Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sat, 2 Oct 2010 21:38:28 -0400 Subject: [PATCH 1/1] arithmetic tweaks Signed-off-by: Jim Pryor --- arithmetic.mdwn | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/arithmetic.mdwn b/arithmetic.mdwn index fafecafd..289b2843 100644 --- a/arithmetic.mdwn +++ b/arithmetic.mdwn @@ -1,5 +1,17 @@ Here are a bunch of pre-tested operations for the untyped lambda calculus. In some cases multiple versions are offered. +Some of these are drawn from: + +* [[!wikipedia Lambda calculus]] +* [[!wikipedia Church encoding]] +* Oleg's [Basic Lambda Calculus Terms](http://okmij.org/ftp/Computation/lambda-calc.html#basic) + +and all sorts of other places. Others of them are our own handiwork. + + +**Spoilers!** Below you'll find implementations of map and filter for v3 lists, and several implementations of leq for Church numerals. Those were all requested in Assignment 2; so if you haven't done that yet, you should try to figure them out on your own. (You can find implementations of these all over the internet, if you look for them, so these are no great secret. In fact, we'll be delighted if you're interested enough in the problem to try to think through alternative implementations.) + + ; booleans let true = \y n. y in ; aka K let false = \y n. n in ; aka K I @@ -228,6 +240,10 @@ Here are a bunch of pre-tested operations for the untyped lambda calculus. In so let length = Y (\self lst. isempty lst 0 (succ (self (tail lst)))) in + true + + -- 2.11.0