Learning functional programming in javascript: A roadmap
Tags: javascript, functional, beginners
Published: 2020-04-03 13:20:46

---
title: Learning functional programming in javascript: A roadmap
published: true
description: Table of content for the series: Functional programming for your everyday javascript
tags: #javascript #functional #beginners
canonical_url: https://vonheikemen.github.io/devlog/web-development/learn-fp/roadmap/
---

> Puedes leer la versión en español [aquí](https://dev.to/vonheikemen/lo-que-se-del-paradigma-funcional-590d).

Learning about functional programming is not an easy task, specially if you search for articles that have concrete examples of the concepts they try to teach. I have been learning about this paradigm for a while and I want it to share the notes I have taken, the ones I've turn into articles, and also the source material where I got the information.

Even though all these articles are related I didn't plan on writing them. So, I'll be presenting some sort of guide (a suggestion) on the order they should be read.

> Some of these articles are available in the form of an [observablehq](https://observablehq.com/) notebook, where you can play around with the source code of every snippet. If there is an asterisk it will take you there. You can also find them [here](https://observablehq.com/collection/@vonheikemen/functional-programming-for-your-everyday-javascript).

## The basics

To begin I would like you to see the video of the talk that convinced me to try learning this paradigm. The talk is about what is and what isn't functional programming, it also shows some examples of the core principles using javascript.

{% youtube qtsbZarFzm8 %}

To complement that video I wrote my own notes.

- [Pure functions and why they are a good idea](https://dev.to/vonheikemen/pure-functions-and-why-they-are-a-good-idea-2n5g)

- [Dealing with side effects and pure functions in javascript](https://dev.to/vonheikemen/dealing-with-side-effects-and-pure-functions-in-javascript-16mg)

### Further reading

- [An introduction to functional programming](https://codewords.recurse.com/issues/one/an-introduction-to-functional-programming)

## A very special tool

If you read everything so far you already have enough knowledge to add some functional style to your everyday coding. You don't have to know every trick in the book to start seeing the benefits of this paradigm.

So, I want you to pay close attention to something called **partial application**, just like the concept of a **pure function**, partial application can help you a lot even if you decide you don't want to write code in a functional style.

This are my notes on the topic (with practical examples): 

- [Partial application](https://dev.to/vonheikemen/functional-programming-for-your-everyday-javascript-partial-application-6dm). ([*](https://observablehq.com/@vonheikemen/partial-application-in-javascript))

If you are convinced that this is useful then watch this video, in here you can see the kind of thing you can accomplish.

{% youtube m3svKOdZijA %}

## How to put the pieces together

Now, knowing the basics is one thing, it's a whole other deal knowing how to use them in the most effective way. You already have the tools but you might be wondering how all of this fits together, that is our next step.

In this article we are going to learn how to use everything we have learned.

- [Composition techniques](https://dev.to/vonheikemen/functional-programming-for-your-everyday-javascript-composition-techniques-4663) ([*](https://observablehq.com/@vonheikemen/composition-techniques-in-js))

Just in case you missed it. In this talk (the source of the previous article) you can see in more detail what composition is about.

{% youtube vDe-4o8Uwl8 %}

## One step further

By now you must know how to manipulate functions and make them do your bidding. But I bet there are still things you want to know in more detail, two in particular: Functors and Monads. So, I'll try my best to tell you how you can use them to your advantage.

- [Have you met Functors?](https://dev.to/vonheikemen/functional-programming-for-your-everyday-javascript-the-power-of-map-4n9m) ([*](https://observablehq.com/@vonheikemen/about-functors))

- [Something about Applicative functors](https://dev.to/vonheikemen/what-are-these-applicative-functors-you-speak-of-4j6f)

- [An introduction to Monads](https://dev.to/vonheikemen/an-introduction-to-monads-in-js-2f7d)

- [Using a Maybe](https://dev.to/vonheikemen/functional-programming-for-your-everyday-javascript-using-a-maybe-126j) ([*](https://observablehq.com/@vonheikemen/using-the-maybe-type-in-js))

## Extra content

- [Reduce: how and when](https://dev.to/vonheikemen/reduce-how-and-when-2cj9) ([*](https://observablehq.com/@vonheikemen/reduce-how-and-when))
- [The case for reducers](https://dev.to/vonheikemen/the-case-for-reducers-101l)
- [Transducers in javascript](https://dev.to/vonheikemen/transducers-in-javascript-3gfm)
- [Lenses: an alternative to getters and setters](https://dev.to/vonheikemen/lenses-a-k-a-composable-getters-and-setters-16jd)
- [Exploring Fantasy Land](https://dev.to/vonheikemen/tagged-unions-and-fantasy-land-4kjc) ([*](https://observablehq.com/@vonheikemen/tagged-unions-and-fantasy-land-in-js))

### More interesting talks

If you're still wondering what you can do just by composing functions just watch this.

- [Mary had a little lambda](https://www.youtube.com/watch?v=7BsfMMYvGaU)
- [Oh Composable World!](https://www.youtube.com/watch?v=SfWR3dKnFIo)

## 'Til next time

If you got here and read everything then you know as much as I do. Got nothing else to show you. Whether you decided to adopt a fully functional style or not I hope you learned something that you can apply in your everyday coding.

---

If you find this article useful and want to support my efforts, [buy me a coffee ☕](https://www.buymeacoffee.com/vonheikemen).

[![buy me a coffee](https://res.cloudinary.com/vonheikemen/image/upload/v1618466522/buy-me-coffee_ah0uzh.png)](https://www.buymeacoffee.com/vonheikemen)