Buy new:
$29.99$29.99
FREE delivery:
Tuesday, Feb 14
Ships from: Amazon.com Sold by: Amazon.com
Buy Used: $22.03

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.


Functional Programming, Simplified: (Scala Edition)
Price | New from | Used from |
- Kindle
$9.99 Read with Our Free App - Paperback
$22.03 - $29.99
Enhance your purchase
Sale! This book is currently on sale! The normal price is $34.99.
If you’ve had trouble trying to learn Functional Programming (FP), you’re not alone. In this best-selling, highly-rated book, Alvin Alexander — author of the Scala Cookbook for O’Reilly, the Scala Book for the official Scala website, and former teacher of Java and Object-Oriented Programming (OOP) classes — writes about his own problems in trying to understand FP, and how he finally conquered it (and you can too!).
In this book he teaches FP in a simple style, without worrying about abstract concepts like functors, monads, and category theory. Instead, he explains FP through a series of small, pragmatic lessons and examples.
For instance, the first thing he learned is that experienced FP developers (FPers) are driven by two goals: to use only immutable values and write only pure functions. But then later he learned the REAL truth: FPers have these goals because their true desire — or mental model — is that they want all of their code to look and work just like algebra.
While that sounds simple, it turns out that these goals require them to use some advanced Scala features — which they often use all at the same time. As a result, their code can look completely foreign to novice FP developers. As Mr. Alexander writes, “When you first see their code it’s easy to ask, ‘Why would you write code like this?’”
But then Mr. Alexander answers that “Why?” question by explaining the benefits of writing pure functional code. Once you understand those benefits — your motivation for learning FP — he shares five rules for programming in the book:
- All fields must be immutable (‘val’ fields).
- All functions must be pure functions.
- Null values are not allowed.
- Whenever you use an ‘if’ you must also use an ‘else’.
- You won’t create OOP classes that encapsulate data and behavior; instead you’ll design data structures using Scala ‘case’ classes, and write pure functions that operate on those data structures.
In the book you’ll see how those five, simple rules naturally lead you to write pure, functional code that reads like algebra. He also shares one more Golden Rule for learning:
- Always ask “Why”?
Lessons in the book include:
- How and why to write only pure functions
- Why pure function signatures are much more important than OOP method signatures
- Why recursion is a natural tool for functional programming, and how to write recursive algorithms
- Because the Scala ‘for’ expression is so important to FP, dozens of pages explain the details of how it works
- In the end you’ll see that monads aren’t that difficult because they’re a natural extension of the Five Rules
- The book finishes with lessons on FP data modeling, and two main approaches for organizing your pure functions
As Mr. Alexander writes, “In this book I take the time to explain all of the concepts that are used to write FP code in Scala. As I learned from my own experience, once you understand the Five Rules and the small concepts, you can understand Scala/FP.”
Please note that because of the limits on how large a printed book can be, the paperback version does not include all of the chapters that are in the Kindle eBook. The following lessons are not in the paperback version:
- Grandma’s Cookies (a story about pure functions)
- The ScalaCheck lessons
- The Type Classes lessons
- The appendices
Because those lessons didn’t fit in the print version, they have been made freely available online.
- ISBN-101979788782
- ISBN-13978-1979788786
- Publication dateDecember 7, 2017
- LanguageEnglish
- Dimensions7 x 1.64 x 10 inches
- Print length728 pages
![]() |
Frequently bought together
- +
- +
Customers who viewed this item also viewed
Editorial Reviews
About the Author
Product details
- Publisher : CreateSpace Independent Publishing Platform (December 7, 2017)
- Language : English
- Paperback : 728 pages
- ISBN-10 : 1979788782
- ISBN-13 : 978-1979788786
- Item Weight : 2.94 pounds
- Dimensions : 7 x 1.64 x 10 inches
- Best Sellers Rank: #661,209 in Books (See Top 100 in Books)
- #56 in Functional Software Programming
- #497 in Computer Programming Languages
- #835 in Microsoft Programming (Books)
- Customer Reviews:
About the author

Alvin took the circuitous route to software development. He managed to get a degree in Aerospace Engineering from Texas A&M University when all he was really trying to do was play baseball. Once he became a practicing engineer, he realized he liked software and programming more than engineering. So in approximate order he taught himself Fortran, C, Unix, and network administration, sed, awk, Perl, Java, Python, Ruby, JRuby, Groovy, PHP, and Scala.
During this process he started a software consulting firm, grew it to fifteen people, sold it, and moved to Alaska. After returning to the “Lower 48,” he self-published two books (“How I Sold My Business: A Personal Diary”, and “Zen and the Art of Consulting”). He also created alvinalexander.com, which receives millions of page views every year.
These days Alvin is a survivor of two types of cancer and two rare blood diseases. He runs his consulting business, Valley Programming (valleyprogramming.com), and hopes to one day get back to running his 501(c)(3) nonprofit charity, the Zen Foundation (zenfoundation.org).
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon
Reviewed in the United States on April 1, 2019
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Thanks to this book, I'm starting to believe that the right boundary between services and data pipelines is somewhere between object-oriented and functional programming paradigms. Those paradigms are another set of trade-off's for software and data engineers engineer to have in their tool-kits.
Functional programming is like guardrails for code in distributed computing environments. Simple and extremely powerful when basic rules are followed. Because math.
The book doesn't cover much about Spark-specific topics, and yet was still hugely beneficial for me because I realized that a DataFrame is just another data type. FP concepts can be applied to a DataFrame in the same way they apply to a string, int, list, map, or any other data type.
While there a more technical introductions to FP such as Functional Programming in Scala, I had tried it and found it hard going. The exercises in particular went a bit beyond simply illustrating the concepts, and were just plain hard.
This book on the other hand has a lot more conversational approach to FP. The author explain the concepts one by one, building on top of precedent lessons. He also talks about how he feels about each concept, what new ability it gives us, when it is good to use, etc.
I often see Functional Programming in Scala as a book that gets recommended to aspiring functional programmers and that suggestion is very misguided. Functional Programming in Scala is terrific once you've been doing FP for a few months to a year.
Functional Programming is daunting and hard to learn: Functional Programming Simplified makes that easier. It is the book to get you started on FP.
Wish I could rate it more highly.
Overall the book is well-written and approachable. It covers everything you could want to know about functional programming, and every chapter has several links to more books and sources in case you want to dig even deeper.
Top reviews from other countries

On the other hand, Alvin Alexander's writing is clear and easy to read, and despite not being a newbie, I learnt a few new things, so perhaps my difficulties with this book were that I'm not the target audience.

With that being said, not saying the book is useless, i found it presents some good arguments in the pros and cons of FP and the Monad concept is well explained (slowly), what I complain is the pages of the book could easily cut down to half without losing anything.

I'd certainly recommend this to any developer who wants to learn functional programming.

There are large sections which are useful to read but beware this is quite a rambling account of fp not useful to anyone with any non-trivial experience of Scala.

Coming from no prior functional programming experience apart from bits of internal iterations with lambdas and predicates in Java 8 I must admit... wow. What a book. Two weeks passed since I got it, I am on page 200 already (sic!) and enjoy every smallest bit of it. Alvin Alexander did an INCREDIBLE job of a really thorough introduction, he told the readers not to be afraid of FP jargon, he first explains an idea without telling you what it is, introduces you to a common pattern to then tell you... "it wasnt too bad too follow right? oh btw, in FP jargon we call this X". Every 10 pages I feel another lightbulb goes on in my understanding on functional programming.
Too bad I can't grade higher than 5 stars. My company uses FP extensively and coming from procedural, OO programming I have to learn it too. Definitely I will be speaking to the company to buy a few copies to add to their library. An absolute must-read for anyone who wants to understand FP.