Lambda Calculus - Church Numerals

So while I was surfing on the internet, I bumped into things I picked when I was in school, lambda calculus being one of them. Now, I admit I’m not a theoretician or even a computer scientist, but this really amazed when I first learned it.

So it seems to me the great computer scientist, Alonzo Church, famously known for the Church–Turing thesis and lambda calculus (foundation of functional programming), had a problem he had to solve.

He had to define (almost) everything computable in functions, so he could come up with lambda calculus. And he couldn’t do it without first defining the natural numbers (0,1,…) with functions, so he went ahead and did that.

And the screenshot (2nd screenshot, obviously ;)) below was how he did it. By applying the function f, to the function x, n times, to replicate the idea of a natural number.


Screen Shot 2019-04-02 at 3.42.49 PM.png


Now read this

Class as Syntactic Sugar of Functions in Python

More explanation coming up, but essentially I’ve tried to define classes with functions in Python for a couple times already, but this time I have something that looks pretty good. To use it, you just have to provide the class name and... Continue →