The definitive guide to learning functional programming

As part of Functional February, we want to collate the best resources for functional programming. If there’s a book, video, podcast, course (or anything else!) that helped you learn or master functional programming, please list it in the thread, and we’ll keep this post updated!

Courses

  • The Exercism Elixir and F# tracks have detailed syllabuses covering lots of functional programming concepts. The Clojure track is a little more WIP but also great! Then practice your functional skills across a wealth of languages!
  • F# for fun and profit: A free course to help get you thinking in the functional way using the F# programming language.
7 Likes

Sites I personally used and can recommend:

Sites that I have on my radar but can’t vouch for:

Edit: Most languages have a section that links to external learning resources, maybe we can encourage people to look there?
Edit2: Thank you to @MatthijsBlom for pointing me to the open source fork of “Learn You a Haskell” that is more up to date

2 Likes

The following books are not about learning functional programming languages per se, but about functional programming more generally.

  • «Algebra-Driven Design» by Sandy Maguire.
    Don’t let the title scare you off! This book is not mathy at all. Or at least, not in the traumatizing way.
    This book is about design. Of course. Click the link for a description. There is a free sample.

  • «Parallel and Concurrent Programming in Haskell» by Simon Marlow.
    Freely available through that link, even though O’Reilly likes to obscure this.
    Basically a very long tutorial. Two, actually. Does require some working knowledge of Haskell (how much? Just try chapter 2), but is also more so than one might expect a book about parallelism and concurrency in general. Expect to fairly easily understand the concurrency model of the proverbial any other language when you have finished this book.

  • «Purely Functional Data Structures» by Chris Okasaki.
    Referential transparency has consequences in design and characteristics of data structures. This book lays these out.
    Uses ML (+ Haskell translations in appendix) for illustrations, but is not about that language and does not require advanced language knowledge.
    Okasaki’s Phd thesis is freely available as an alternative.

On a personal note: should you like to go through one of these books together, I would gladly join in.

4 Likes

Haskell

Online environments: TryHaskell (for your first 5 minutes), Repl.it, and Haskell Playground. Apparently there is also an online code formatter: ormolu-live.

Local installation: see the guide on Exercism.

Books & such (extensive tutorials are scarce):

YouTube:

5 Likes

A massive amount of links to free courses, books, competitions etc in many languages can be found on github. Found Exercism under the link “Problem Sets and Competitive Programming”.
As preparation for Functional February I’m doing a Haskell MOOC at MOOC.fi (recommended by vaeng on this site by the way).

3 Likes

If you have a basic grasp of Scala, the Neophyte’s Guide to Scala is great to further master the language.

I found the book Getting Clojure by Russ Olsen to be a wonderful introduction to both functional programming and Clojure for someone who was not familiar with either.

2 Likes

Great and comprehensive list. I was already a seasoned imperative programmer when I first started Haskell 5 years ago, and I can highly recommend Learn You a Haskell for Great Good! to get you started quick, and $ Programming in Haskell as an in-depth guide.

My team and I really enjoyed the second edition of this book (Scala 3) $ Functional Programming in Scala, Second Edition. I was given a free e-book of edition 1 (Scala 2) when I bought the second Edition.

For those going the F# route look into this guy Scott Wlaschin, he has great youtube videos and an excellent web site/blog : fsharp for fun and profit as mentioned above

I just remembered that Alexis King has an excellent blog. The following posts are potentially of interest to non-FPers (sorted by recommended reading order).

  • «Types as axioms, or: playing god with static types»
    Written specifically for people unfamiliar with (advanced) static type systems.
    Starts with the question: just what exactly is a type? Discusses how types can liberate you instead of constrain.
  • «Parse, don’t validate»
    Though still young, this is post is definitely a classic and already part of the common FP wisdom. Touches on how to use (as opposed to merely suffer) the type system.
    The title might suggest to you that it is about languages and grammars and mathy stuff and such. It isn’t. Rather, it is about program design, and broadly applicable.
1 Like

Haskell

I’m only a year or two into my very exploratory Haskell journey and took lots of notes along the way, so hope this helps other beginners!

  • Another vote for Learn You a Haskell for Great Good! to get you started.
  • Honestly I primarily paired LYAH with Exercism to support the majority of my learning!
  • Then I enjoyed Real World Haskell as a useful supplement that extended from concepts to some basic applications. Though I must admit the greatest lesson was… never trust the comments! The book is also a brilliant experiment on crowd sourcing your editing and I think the conclusion is clear: the barrier to commenting is vastly lower than to authoring.
  • But first, I implore you, fully acknowledging this is self-promotion, to please read my Hacking With Haskell guide on setting up your dev environment. There’s a lot of outdated advice out there, but if you configure your tools right, they will absolutely delight you with the joys of a statically typed language with both REPL and compiled modes of execution. Note that if you’re solving Exercism exercises then they come ready to go as excellent little stack packages, so you don’t need the hacks I describe, but you will want to hack too…
  • Also agree, Alexis King’s stuff is awesome. Just remember, Haskell has been evolving for a long time so there’s lots of true-at-the-time advice out there, particularly when it comes to packaging. Again, I offer my recent, hard-earned learnings on efficient and painless package management.
1 Like

Real World Haskell is very dated at this point. I hear the comments are/were generally very good; they might just not be relevant any more. Someone is writing an updated version.

I’ve been working on the Haskell track on and off for about 6 months now, got 6 more questions to go. I’ve curated a list of Haskell resources on my blog.

I really like Haskell. I actually started my FP journey with Scala years ago, but the abuse of implicits turned me away.

1 Like

I just remembered that there is an excellent talk on Clojure by James Trunk called “Clojure in a nutshell”. It is not only great because it has Rich Hickey quotes, but also because it shows off everything you need to know to start writing expressive, functional code in less than 30 minutes. One of my favourite live demos.

4 Likes

A post was split to a new topic: Tracking Settings in the Forum seem buggy

A recent book which covers simple Scala is Grokking Functional Programming.

An old book which covers C# and F# is Real World Functional Programming.

Manning books have usually represented a good value to me, especially their “… in Action” books.

1 Like

Speaking of Manning books, these two deserve a mention:

Data-Oriented Programming by Yehonatan Sharvit
Grokking Simplicity by Eric Normand

They both detail the functional programming philosophy of programming with just functions and data, but use JavaScript for all the examples in order to make the content as accessible as possible.

Afterwards, the two authors ended up joining forces to do workshops, because it turned out that they compliment each other very well.

2 Likes

I just purchased Eric’s book, Grokking Simplicity, to use as a guide for the rest of the streams for FunFeb.

It’s a uniquely suitable text for this because it:

  1. Is language agnostic
  2. Sticks only to material that is relevant to writing actual programs
3 Likes

Graham Hutton also has some nice Youtube videos coming up: Functional programming basics & Advanced functional programming.

1 Like