From: Jim Pryor Date: Thu, 30 Sep 2010 18:31:25 +0000 (-0400) Subject: tweaked arithmetic X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=cbb48495bd8cd6cdcbebd1bcd8c3051148c8b0a6;hp=0dd9b48d6a2e74d618a99a101f0122f4d7c076fb tweaked arithmetic Signed-off-by: Jim Pryor --- diff --git a/arithmetic.mdwn b/arithmetic.mdwn index d2724875..bc15ae8d 100644 --- a/arithmetic.mdwn +++ b/arithmetic.mdwn @@ -44,6 +44,7 @@ Here are a bunch of pre-tested operations for the untyped lambda calculus. In so let map = \f lst. lst (\h sofar. make_list (f h) sofar) empty in let filter = \f lst. lst (\h sofar. f h (make_list h sofar) sofar) empty in ; or let filter = \f lst. lst (\h. f h (make_list h) I) empty in + let reverse = \lst. lst (\h t. t make_list (\f n. f h n)) empty in ; version 1 lists