Dan Mead on 2 Nov 2011 20:04:45 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: the natural numbers using lambda calculus


cool shit. I remember there being a haskell tutorial that showed how to do this plus some other stuff

this also might be useful

http://en.wikipedia.org/wiki/Church_encoding

On Wed, Nov 2, 2011 at 7:01 PM, Jim Snavely <ludflu@gmail.com> wrote:
(see attached)


On Wednesday, November 2, 2011, Jim Snavely wrote:
Ok, this paper sort of blew my mind a little. I knew a little about
lambda calculus before this...but not really, I realized.

As usual, the only way I understand anything is by writing working
code. The following is the logical operations section translated into
Haskell. (note the backslash is Haskell syntax for a lambda
_expression_)

true = \x y -> x
false = \x y -> y

toBool f = f 1 2 == 1

land = \x y -> x y (\u v -> v)
lor = \x y -> x (\u v -> u) y

lnegate = \x -> x (\u v -> v) (\a b -> a)

main = print $ toBool $ lnegate false

or try:

main = print $ toBool $ true `land` false

contrast with:

main = print $ toBool $ true `lor` false


--Jim


On Wed, Nov 2, 2011 at 12:15 AM, Dan Mead <d.w.mead@gmail.com> wrote:
> the other longer paper gives alot of good definitions that this one kind of
> just skips over. I'll bring printouts.
>
> Dan
>
> On Tue, Nov 1, 2011 at 2:42 PM, Lalish-Menagh, Trevor <trev@trevmex.com>
> wrote:
>>
>> Hi all,
>>
>> Don't forget that tomorrow night at 6:30pm is Functional Fall 5 at the
>> Comcast Center (Room 45P). We will be
>> reading "A Tutorial Introduction to the Lambda Calculus."
>> (http://www.utdallas.edu/~gupta/courses/apl/lambda.pdf)
>>
>> As always there will be pizza and cola provided, and beer afterwards.
>>
>> Don't forget to RSVP at http://www.doodle.com/dvd85t6iw8hs8vqp
>>
>> I hope to see you there!
>>
>> Yours,
>> Trevor
>> --
>> Trevor Lalish-Menagh
>> trev@trevmex.com
>> 484.868.6150 (mobile)
>> trevmex (AIM)
>
>



--
--Jim


--
--Jim