I suck at these kind of things, I am currently reading Haskell Programming - From first principles, it’s a great book but I don’t really get the Lambda calculus, maybe I have to wait a bit more to understand it better.
I would love if any of you lads could take a few minutes and explain it to me.
I can’t explain it well enough to help you, but I am more than halfway through that book and I’m doing great without being an expert at LC, so don’t sweat it.
Here’s a classic talk that touches on some concepts: https://www.youtube.com/watch?v=FITJMJjASUs
What do you think about it so far? At first I thought that it’s a bit expensive but for the amount of content, and good reviews it had, I couldn’t stop myself from buying it. I don’t regret it so far.
It’s probably the best language learning book I’ve read. It’s well written, has a great flow of subjects, and most importantly: TONS of exercises. Too many developers think they can learn by just reading. Doing reading and exercises daily helps so much! Stick with it and enjoy it!
When I was learning I found the lambda calculus reduction workbench helpful. Starting out I recommend playing around with several expressions in normal evaluation order with tracing on. Some good examples to start:
No reduction cases
x applied to variable
x y ==>
- abstraction (lambda) without application:
Simple reduction cases
- abstraction with application:
(\x.y) z ==>
- the identity function applied to
(\x.x) z ==>
\x.(\y.z) x ==>
That last one is evaluated by the workbench to
\x.z instead of
\y.z, but they’re equivalent because when applied to anything they both reduce to
z. I use
\y.z here because it’s makes the eta-conversion step clearer. Renaming that results in no behavioral change is called alpha-conversion. The first two reduction examples, where abstractions were applied to other expressions, are called beta-reduction.
Even after understanding how to formulate and evaluate LC expressions it may not be clear why LC is useful. To understand that, I recommend studying Church encoding and fixed-point combinators. Once that’s clear you’ll realize how you could use a machine like the LC reduction workbench for arbitrary computation.
I don’t understand how somebody could simply learn just by reading, getting your hands dirty is what does the most for me. Having the code in my hands and being able to play with it is what makes learning fun.
Thanks so much for the explanation and links, really helpful!
Like others have noted in this thread, teaching LC in an answer is not feasible.
Maybe you could ask a question and get back a
Just Answer (see what I did here? If not, wait till you hit the “Signalling adversity” chapter).
At any rate, you don’t have to know or even understand LC, nor category theory, nor math for that matter to be competent, at the very least, at Haskell.
And for reaching that goal, “…from first principles” is pretty much the best resource you can get your hands on. Personally I ditched “Learn you…”, a great resource in and of itself, in favor of “First”.
Welcome to the club
My material for haskell
if you have some questions about book you can ask on
Some my code, but not so much so far
Another helpful starting point is the recent Computerphile video on LC.
That nails how brutally simple LC is.