Functional Programming resources I’ve found useful
I’ve got a chance to walk through my trading card game kata with a bunch of passionate new grads in a personal boot camp run by Salah Chalermthai. The code is written in TypeScript but in a very functional manner. They asked me to point out some good resources about functional programming. So I compiled this list to aid their curiosity.
I would like to separate into 3 sections, Practical, Theoretical and Interesting Functional Languages. While practicality is important, understanding the underlying concept of things makes you better at reasoning about and utilize tools in your toolbox. Learning different languages that has different philosophy can change the way you think about programming. I will point out some languages with different flavors so you can explore.
Practical
Hello, Functional Programming!
Well, this has written by me. It’s a very brief introduction to the subject, just to get the sense of what it means.
SOLID: The Next Step is Functional
This one is about design principle that is widely known in OO community. SOLID has been discussed in the boot camp so I think it would be interesting to look at it from a functional lens.
Professor Frisby Introduces Composable Functional JavaScript
Functional programming tends to be discussed in a very abstract manner since it has a lot of useful composable abstractions at hand to be used to reason about and model things. This course is more example based, practical use case driven and when you see the pattern they will extract those patterns and form abstractions which can be reused further in many context.
One of my favorite website about functional programming. The author use F# language as a medium to talk about lots of interesting concept in functional programming and how can they be useful in solving real business problem.
From Design Pattern to Category Theory
How do you design good abstractions? By using abstractions that already exist.
This series of blog posts talk about utilizing a branch of mathematics called Category Theory as design patterns. Category Theory has bunches of small and lawful, well defined abstractions which we can built upon. It’s a study of mathematical structures but turns out to be very useful in programming as well.
Theoretical
Lambda Calculus — Fundamentals of Lambda Calculus & Functional Programming in JavaScript
Lambda Calculus is a formal system for expressing computation which can simulate any Turing machine. It’s based on function abstraction and application which is the basic of functional paradigm.
Category Theory for Programmer
If you get hooked into Category Theory at some point and wants to understand more about what it actually means, this might be interesting for you. This will take you to have a deeper look into Category Theory and also map those ideas into Haskell (I also learn a bit of Haskell in the mean time).
There’s also a video version and pdf version.
Warning: this might be very abstract to some, it takes sometimes to digest. I would not recommend this for those who has just started functional programming but after awhile you will encounter those weird terms from Category Theory, so come here when you are really curious about it.
Interesting Functional Languages
An advanced, purely functional programming language. It’s not a must learning Haskell to understand FP but if you want to really understand FP, you should give it a try.
Haskell resources:
- Learn You Haskell for Great Good!
- Haskell programming from first principles
- What I Wish I Knew When Learning Haskell
While Haskell type system is static. Clojure is dynamic. Clojure takes different approach from Haskell which has a lot of higher level abstraction, Clojure only cares about few set of data structures and lots of functions to manipulate them.
Clojure resources:
Elixir has a friendly syntax like ruby with a lot of language features that aids functional paradigm. It runs on Erlang vm which is used for building highly concurrent system for telephone switches back in the days. Elixir can spawn a very lightweight process and send messages to each others which is a very nice building block for modelling concurrency.
I hope this is useful :)