This book is self-published by me, Alvin Alexander, and as I note in this tweet ( https://twitter.com/alvinalexander/status/1419729072805003272), in July, 2021, this book is now the #2 best-seller in Amazon’s “functional programming” (FP) category that is actually about FP. (For some reason, nine of their top eleven books aren’t really about FP.)
As a brief update, in August, 2021 the new Scala Cookbook has just been released. Find it here on Amazon: https://amzn.to/3du1pMR
Why this book might be for you
When I first tried to learn FP I felt hopelessly lost. I tried to learn it through books like the well known “red book,” and as I tried to read that book, it was like the authors were speaking a totally different language — one that I couldn’t understand. They wanted me to do exercises at the end of every chapter, but I couldn’t, because I had no idea what they were talking about.
Frankly, books like that made me feel dumb, like there was no way I was ever going to learn FP.
However, as I would learn in a journey that took me about a year and a half, it’s not that the red book isn’t a good book; it’s just that it’s not meant for beginners. It assumes that you already know a fair amount about FP before you even read it. (Put another way, it’s for intermediate or advanced FP’ers.)
So I wrote this book for beginners, for people like me.
I start with the basics, and each short chapter builds on the one before it. And as you’ll see, one concept naturally flows into the next. After that — just like Sherlock Holmes investigating a problem — you’ll see that each lesson logically follows the previous lesson, and by the time you get to monads, you’ll think, “Of course, this is completely logical. If I was working in the FP field many years ago, I could have discovered monads myself.”
So, what you’ll find in this PDF is that it contains 137 small lessons that you can read in about five minutes each. Depending on your background knowledge, you may also be able to skip many of the lessons.
Please note that this book is written using Scala 2, but the lessons and concepts may apply to many other programming languages.
As of July, 2021, thousands of copies of this book have been sold, and it’s 5-star rated here with 33 ratings, and 4.6-star rated on Amazon, with 126 ratings.
Here’s some of the feedback from readers:
- Your book is fantastic, I can’t find enough words to thank you!
- Best Scala book I’ve read.
- This is a GREAT book!
- I finally understand monads. Thank you!
- I love the writing style and the approach, great job!
- I read this everyday after work and it makes me so happy. Thank you for this amazing book.
- I love the small lessons, they make it easy to read.
- The best $15 spent on a tech book, ever.
- Thanks Alvin for opening the door for this new world.
- Your book was a real game changer to learn FP.
- Very nice explanation. Just awesome.
- Functional Programming Simplified is amazing, thank you for writing this.
- Too bad I can’t grade higher than 5 stars
- Exactly as promised, this book saves you a lot of time
- The best introduction to FP that I have read for people who are coming from an imperative background
- A very concise style that is easy to comprehend
In the book you’ll learn:
- Five important rules for writing FP code in Scala
- Why pure function signatures are much more important than OOP method signatures
- How pure functions work with I/O
- Lessons to simplify recursion
- Partially-applied functions and currying
- Type signatures are covered many times, so your brain can get used to patterns like `StateT[IO,GameState,Int]`
- The proper way to handle exceptions and null values
- Many lessons on for-expressions, which lead naturally into monads
- State and IO monads, and monad transformers like StateT
- Domain modeling with Scala/FP
- An introduction to type classes, including an example with the Cats library
- Handling concurrency with Akka actors and Scala futures
- Visual lessons on collections’ methods like `fold` and `reduce`
- Much more ...
The book is organized into small, single-purpose lessons that flow in a logical order. You’ll see how one concept naturally leads to the next concept, and that concept leads to another one, and so on.
This is the PDF website
On this website (Gumroad.com) you can buy the PDF version of the book. If you’re interested in other versions of the book:
- You can buy the Paperback version of the book here: https://amzn.to/2DJ2s9J
- You can buy the Kindle version of the book here: https://amzn.to/2Bv9LjC
Please note that there are no refunds on digital products like this, so if you want to be sure about what you’re buying, there’s a link to a large, free preview at the bottom of this page.
There are no refunds on digital products like this, but you can obtain a large, free preview of the book at this URL: