Fun with Lambdas
Fun with Lambdas
Fun with Lambdas

This book is 30% complete

Last updated on 2016-06-08

About the Book

"If you wish to make an apple pie from scratch, you must first create the universe."

- Carl Sagan, Cosmos

This book is about nothing. Or, rather, it is about starting with nothing and creating the world. In our day-to-day lives as programmers, we're used to languages that give us a wide range of nouns, concrete things, to work with, Numbers, String, Arrays, and so forth. And we happily combine them, trying to fit them together in such a way that we come out the other end with a large structure that solves our problem.

What we often forget, though, is that, taken by themselves, these structures are useless. When we talk about combining them, we really mean that we set up interactions between them, hoping that we've defined them correctly. Programming, itself, is about looking at and defining the spaces BETWEEN the nouns. And, yet, we don't spend a lot of time focusing there; when we discuss our programs, we often only mention the things. Take a look at a UML diagram: notice what gets the big boxes and what gets small little arrows connecting them.

In this book, we're going to throw away the nouns and only use the verbs. We're going to start with the most basic of things, the verb, something with an input and an output, and build up our world, our concrete structures. This verb, what we'll be using, is called the Lambda.

I'm planning for this book to be around 100 pages, perhaps stretching as high as 150. It is a short, focused, VERY code-heavy walk-through of building up a numbering system, then a character system, ending with strings. Along the way, we'll discuss the Peano axioms, Addition, Subtraction, Lists, Strings, Key/Value Pairs and end with a Dictionary implementation. 


This is the first (hopefully) book in a series I'm thinking of as "Computer Science for the rest of us." This series is for people who have programming experience, but maybe have some holes in their theoretical knowledge, such as the lambda calculus. These are people who are interested in, and perhaps even started books such as "Function Programming through Lambda Calculus," but found it to be opaque and difficult to get into. They've heard of how cool it is, heard mention of church numerals and Cons/Car/Cdr, but nothing has reached out in a nice narrative way for them.

For this reason, I'm going to be staying away mostly from the more "academic" terms (although I might still have an appendix or two that introduces the ideas, especially how First/Second are really the K combinator and K(Identity)) and just walking through with concrete examples. As with my other book, I'll be pointing to other resources to "find out more" rather than padding the book with explanations.

About the Author

Corey Haines
Corey Haines

I'm Corey Haines. I've been developing software professionally since 1995. I've also spent the past 10 years mentoring and training software developers around the world. I currently work as the CTO/Co-founder of Hearken.

I also love cats!

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub