Jump to ratings and reviews
Rate this book

Professor Frisby's Mostly Adequate Guide to Functional Programming

Rate this book
This is a book on the functional paradigm in general. We'll use the world's most popular functional programming language: JavaScript. Some may feel this is a poor choice as it's against the grain of the current culture which, at the moment, feels predominately imperative. However, I believe it is the best way to learn FP for several reasons:

You likely use it every day at work.

This makes it possible to practice and apply your acquired knowledge each day on real world programs rather than pet projects on nights and weekends in an esoteric FP language.

We don't have to learn everything up front to start writing programs.

In a pure functional language, you cannot log a variable or read a DOM node without using monads. Here we can cheat a little as we learn to purify our codebase. It's also easier to get started in this language since it's mixed paradigm and you can fall back on your current practices while there are gaps in your knowledge.

The language is fully capable of writing top notch functional code.

We have all the features we need to mimic a language like Scala or Haskell with the help of a tiny library or two. Object-oriented programming currently dominates the industry, but it's clearly awkward in JavaScript. It's akin to camping off of a highway or tap dancing in galoshes. We have to bind all over the place lest this change out from under us, we don't have classes[^Yet], we have various work arounds for the quirky behavior when the new keyword is forgotten, private members are only available via closures. To a lot of us, FP feels more natural anyways.

That said, typed functional languages will, without a doubt, be the best place to code in the style presented by this book. JavaScript will be our means of learning a paradigm, where you apply it is up to you. Luckily, the interfaces are mathematical and, as such, ubiquitous. You'll find yourself at home with swiftz, scalaz, haskell, purescript, and other mathematically inclined environments.

146 pages, ebook

76 people are currently reading
644 people want to read

About the author

Brian Lonsdorf

2 books11 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
166 (46%)
4 stars
142 (39%)
3 stars
44 (12%)
2 stars
3 (<1%)
1 star
1 (<1%)
Displaying 1 - 30 of 58 reviews
Profile Image for Ilya Ivanov.
25 reviews9 followers
October 15, 2016
This book is your good partner in the journey towards functional paradigm and its tenets. I loved first 2/3 part of the book: functors and monadic expression made my week, but the other half deserves reviewing.
I would definitely recommend this book if you want to feel inspired a bit by functional composition, currying and in general embracing purity of your app.
Profile Image for Mukesh.
6 reviews
February 18, 2017
I read this book after watching Brian's videos on egghead.io (https://egghead.io/courses/professor-...)

Both the videos as well as the book are dense, specially for someone coming from a background of imperative programming. But the real life examples and JS implementations of the concepts help drive the points home.

Solution to real world problems are represented succinctly in the book and makes you want to go back and refactor your existing code as soon as possible. The level of abstraction hurts your brain but in a good way.

At the end of the book, i left with a better intuition about a lot of concepts like - pure functions, currying (and why it's needed), function composition, semigroup, monoids, functors, applicative functors and monads. I also left with a better appreciation for the mathematics behind these concepts. The mathematical laws governing these concepts ensure that the final code is safer, easier to maintain and has lesser entropy.

Overall, A+. Highly recommended.
Profile Image for Kiana.
3 reviews
June 1, 2017
This book is quite dense and makes huge logical leaps, so chapters require re-reads in order to fully grasp a concept. That said, the book is inspiring and fantastic. It's written in a tone that is a bizarre mix of dryly funny and dryly serious. The author definitely should finish it. I'd buy a copy to support the author even though I've already read it.
Profile Image for Chris Nitsas.
44 reviews14 followers
June 2, 2018
Apparently this is a work in progress - more chapters will come in the future.

First of all, congrats to whoever first had the idea to teach functional programming using JavaScript.
As the author puts it:

1. You likely use it every day at work.
2. We don't have to learn everything up front to start writing programs.
3. The language is fully capable of writing top notch functional code.

Concerning the content:

I had no idea there's so much to learn about functional programming! Ok, I knew some things about pure functions, currying, partial application, and function composition*, but that was it. This book talks about all that, plus containers, functors, monads, and applicatives. And apparently there's more to come in not-yet-written chapters..

By the way, sorry for all the jargon - unfortunately I cannot explain all those terms in the context of a book review.

As a taster, one Functor the book talks about is Maybe. Imagine it like a JavaScript "class". It wraps a value and allows you to map a function on the wrapped value, getting back a result that's still wrapped in a Maybe (this allows you to keep mapping other functions on the result).

The whole point of Maybe is that, if you end up with a null wrapped in a Maybe, any function you try to map onto it from then on will just return the same Maybe-wrapped null straight away. This allows you to keep mapping functions - like a pipeline - on your Maybe-wrapped value, and if at some point one of the functions returns a null/undefined, your pipeline won't blow up - you'll just end up with a Maybe-wrapped null in the end.

In regards to the presentation:

Some advanced concepts of functional programming can be a bit hard to follow at times, but the material in the book is explained well. There are enough practical examples to help you grasp the concepts, and each chapter is followed by exercises so you can test your understanding (no solutions are provided, but that wasn't a problem). And the fact that you can try these things out in your browser is a big bonus in my book.

All-in-all I feel like I learned a lot about functional programming, in just 81 pages according to my e-reader (don't know why goodreads says 115). And all that on JavaScript which I can use tomorrow at work! In closing, a very big thanks to the author for this great work, and for making it available for free online.

* Recently stumbled upon Dave Atchley's brilliant "Getting Functional with Javascript" blog series which showcases these techniques.
Profile Image for Chris Daviduik.
38 reviews3 followers
May 23, 2021
Fantastic intro to functional programming. Even if you (like me) don't actually do functional programming (react doesn't count) it is eye opening to see what other approaches there are compared to a lot of the OOP we are often forced to work with. If you are a programmer that is mathematically inclined you'll likely find yourself nodding along through most of this book. My mind was blown multiple times, highly recommended!
Profile Image for Hadi Aliakbar.
3 reviews3 followers
December 11, 2019
one of the best book for starting functional programming
the writer is funny, the examples are good and make sense.

if you want to know what monad is? this book can help you a lot.
Profile Image for Oleg Abrazhaev.
81 reviews8 followers
June 17, 2021
An excellent book to get a deeper understanding of fp. Unfortunately unfinished, better to read online version. It was in my read status for a long time because of that. I would recommend first to start from something easier and get some experience in fp with Scala, TS, JS, etc. Then read this to get an AHA moment about some functions you already used. Gets too complicated as for me in last chapters.
Profile Image for Anton.
50 reviews2 followers
December 13, 2019
Единственная проблема с этой книжкой - что она не дописана. В остальном это идеальная книга для вхождения в функциональное программирование. Я около-функциональный код пишу довольно давно, но благодаря этой книге я наконец понял идею за функторами/монадами. Самое смешное, что концепция довольно простая, но информация по ней обычно либо слишком формальная, либо слишком абстрактная, либо все сразу.

Здесь автор находит идеальный баланс. Первая часть книги посвящена самым основам функционального подхода, всяким функциям высшего порядка, каррированию композиции и прочему. Для меня это уже вещи очевидны. Дальше начинаются функторы, автор сначала объясняет на конкретных примерах что из себя представляет функтор, как он работает и главное как с ним работать. И лишь потом объясняет математическую красоту лежащую за всем этим. Математическая основа довольно серьезная, автор залезает на поле Теории Категорий что бы показать какие чудеса могут вытворять функторы.

Книжку могу советовать всем у кого есть какой то опыт программирования и кому может быть интересно как писать программы не-императивно и что это дает.
Profile Image for Mohammad Forouhesh.
14 reviews18 followers
February 11, 2023
Functional Programming is the way to go for building robust, reliable, and reusable code. But beyond the syntactical elements, what lies behind the constructs?

Professor Frisbee's Mostly Adequate Guide to FP is an absolute must-read for anyone interested in designing and developing declarative, side-effect-free, composable, and reusable software systems. With only 125 pages, the book illustrates how working with functions instead of objects is an elegant and powerful approach to developing complex systems. Despite its short length, it provides a comprehensive introduction to functional programming. Throughout, the tone is enjoyable and humorous. In addition, there are some theoretical explanations of major ideas. Ultimately, the book is more of a programming book than a textbook on Category Theory or Lambda calculus. I highly recommend this book to anyone looking for a thorough introduction to the subject!

- Mohammed Forouhesh
Profile Image for Landon.
21 reviews1 follower
August 30, 2017
I came to this book having read several articles and a couple books on functional programming. Until I read this book, I can't say I had internalized the concepts. This book opened my eyes to a brand new way of thinking about my code. It's full of detailed, useful examples, and its quirkiness is fun. I'd highly recommend it to anyone looking to take the leap into functional programming.
Profile Image for Chrisman.
393 reviews15 followers
June 20, 2020
I read this the first time years ago when I was just starting my career in programming. I was enchanted by this strange new world of functors and monads, and it had a big impact on the way I think about data flow and error handling and side effects and declarative programming.

More of it "stuck" on re-reading.
Profile Image for Clyde Wonder.
Author 1 book1 follower
February 14, 2025
Full disclosure. This is a geeky book likely to be of interest to a relatively small subset of the human race. That said, it's a great little book, well-written in witty prose with great examples.

He covers a ton. And I admit I got lost pretty early in. There was a lot of "rereading." And, pro tip, have your text editor and/or a Node console at the ready. Not smart to read this without those valuable companions.

Functional programming is not for the faint of heart. I've been writing software on and off for over 40 years and still, it was tough to wrap my head around this stuff. Maybe people who didn't start out in procedural C won't have the same challenge migrating. Hard to know.

But even with the dubious understanding I came away with, this was a fun read. I mean who can't love chapter intros like this:

In this chapter, we will examine monoids by way of semigroup. Monoids are the bubblegum in the hair of mathematical abstraction. They capture an idea that spans multiple disciplines, figuratively and literally bringing them all together. They are the ominous force that connects all that calculates. The oxygen in our code base, the ground on which it runs, quantum entanglement encoded.

If you like yourself some math and some esoteric coding philosophy, jump in here. The resulting code ideas are elegant and profoundly safer than the majority of code written today. Just be prepared to read things a few times.
Profile Image for Kristiyan Bonev.
108 reviews4 followers
October 22, 2020
Many things that didn't make sense before now do. This is enough to make it a worthy experience. I really liked the 1-7 chapters and 10-12 ones.

There was a bit of a hard part to read in chapters 8 and 9. I switched machines at that point and started using the provided code functions and suddenly my demo outputs started changing. I had initially followed the book and everything was working, but I no longer had that code. However, I expected that the provided code would work the same way, which was a bit confusing at the wrong moment.

I would've also appreciated a side-by-side display of the old and new version of code when we were refactoring/improving something we had already created "wrongfully" previously.

Those are only nitpickings, but it's the stone in the shoe heh.

Probably gonna move on and come back to it in a month or two to check how well those concepts have settled in my brain.
Profile Image for Stan.
4 reviews
January 27, 2017
If you are new to functional programming this one book can provide an excellent introduction. You are gently thrown into a world much different than the one of object-oriented programming. Professor Franklin Risby covers the basics well in the first few chapters and then goes on to discuss functors, monads, etc.

I highly recommend doing the exercises in this book and re-reading chapters to grasp some of the more foreign (at first) concepts.

The one thing I did not like about this book is the frequent use of Americanisms. You do get used to Professor Risby's writing style after a while, though.
14 reviews2 followers
June 1, 2018
Interesting content and clear explanations. The exercises are a little confusing (obj is not always clear) and frustrating (opaque error messages).

The book assumes you'll figure out it's JavaScript DSL organically as you read (especially by going through the appendices), which is fine... but readers could probably benefit from a little more explanation

Overall, after reading the 1st 12 chapters, I feel like I have general understanding of the concepts. This is a notoriously difficult area. It will still take some extra reading and learning to apply any of this in practice (esp using a different language).
12 reviews1 follower
February 9, 2020
This work clearly accomplishes its goal. Which is to introduce the reader, with a previous understanding of OOP and Javascript into the Functional Programming land. It does so by exemplifying and implementing its own version of the tools and techniques that most FP languages have built-in.

I'd certainly recommend it to any newcomer in the field of FP, as it's well prepared to go step-by-step with clear exercises and examples.

The only con is, personally, I'm not an English native speaker, nor I want to be. I'd like to be able to read the book without needing to have an UrbanDictionary tab open or to dig up on Google every time an author's joke, comparison or example takes place.
Profile Image for Phil Filippak.
116 reviews28 followers
August 23, 2018
The book is a great introduction to the functional paradigm though is yet unfinished. Anyways, I'd recommend it to everyone involved in computer programming (and familiar with JavaScript).

I believe that after some practice with FP I will return to this book, first, to read new chapters, and second, to understand more deeply what I have just glanced at now.
Profile Image for Mostafa elganainy.
1 review2 followers
January 26, 2019
The book has a good balance between practice and theory. Yet, I believe that it could serve only as an intro to both (practice and theory). But one need to read and practice more about the category theory and functional programming after reading to book to be able to fully grasp the presented material.
Profile Image for Finlay.
318 reviews24 followers
June 19, 2017
Very approachable introduction, clarified quite a few things for me. I found his video series more engaging, although it doesn't go into as much detail as this book. Would be nice if the book was updated with ES6 syntax.
Profile Image for Zeyad Etman.
13 reviews7 followers
February 23, 2019
The books is great, The first 7 chapters are so great for me as a not expert JavaScript developer, I think the last chapters are advanced and I’ll return to them if i faced any problems related to their topics.
Profile Image for Carlos.
99 reviews2 followers
June 8, 2019
A nice little book to introduce you to some of the basic concepts of Functional Programming. Nicely written, even though sometimes I still got lost in some of the concepts. I think it's very important to try to do the proposed exercises in order to interiorize some of the ideas.
1 review1 follower
June 18, 2019
Extremely accessible, clear and concise coverage of some of the concepts at the very core of beginner/intermediate Functional Programming. I recommend this book to everyone I know that's looking to learn some FP.
170 reviews4 followers
December 4, 2020
The first seven chapters are well explained, however around chapter eight the concepts really take off. For me, this turned it into a conceptual read and sent me looking for other books that might be more suited to my style of learning.
Profile Image for Weekend Critic.
134 reviews3 followers
March 21, 2021
Amazing book on FP in JS. Might be the best one there is.
Just as any other book on FP the moment it gets to Category Theory or Monoids it does get complex, so beware, especially if you are a newcomer to software engineering.
Profile Image for Marcos Cannabrava.
18 reviews1 follower
March 27, 2022
Very fun read that offers a broad overview of FP concepts. Worth it for the shrewdness of the author alone but I wouldn't say it's very practical. It's a an advanced complement to other more "standard, textbook-like" books
15 reviews
January 2, 2017
Good information, he makes some logical leaps in places that makes it hard to follow. Definitely worth the read and then another. The exercises were also very helpful.
5 reviews1 follower
July 30, 2017
One of the best book in functional programming. Effort taken to explain Functor is worth.
1 review
December 31, 2017
Fantastic book. I will be rereading it again at some point with an eye to going through more of the exercises. I also plan to watch the videos. Lucid and well-organized.
Profile Image for Fer Perales.
50 reviews2 followers
February 22, 2018
El libro clásico de introducción a la programación funcional. Corto y bien explicado
Displaying 1 - 30 of 58 reviews

Can't find what you're looking for?

Get help and learn more about the design.