- 01 Imperative vs declarative
How imperative code differs from declarative in JavaScript: swapping a loop with push for filter and a predicate, then raising the abstraction with filterBy.
- 02 Functional programming
What functional programming means in JavaScript: pure functions, a pipeline of small functions with pipe, and Maybe from head and fromMaybe in Sanctuary.
- 03 First-class and higher-order functions
First-class functions as a property of JavaScript, and higher-order functions that take or return functions: map, React HOCs and Vue slots.
- 04 Closures
Closures in JavaScript: how a function remembers variables from where it was created, function factories, private state, the var loop trap and memory leaks.
- 05 Pure functions
How to tell a pure function from an impure one in JavaScript and return a new object with spread or structuredClone instead of mutating outside data.
- 06 Immutability
Immutability in JavaScript: why mutation breaks code, spread and structuredClone, Object.freeze, non-mutating array methods, R.evolve and the cost of copies.
- 07 Hindley–Milner type notation
Hindley–Milner signatures in JavaScript: how to read a -> b -> c and (a, b) -> c, type variables, [a] and Maybe a, and write a function from its signature.
- 08 Function composition
Composing JavaScript functions with compose (right to left) and pipe (left to right), and writing pipe for any number of functions: loop, reduce, recursion.
- 09 Currying
How a curried JavaScript function waits for all of its arguments, how to curry by hand and with curry, use it in composition and build specialized functions.
- 10 Partial application
How partial application in JavaScript fixes some arguments in advance, how it differs from currying, and how to write your own partial function.
- 11 Point-free style
Point-free style in JavaScript: functions without named arguments via pipe, compose and curried Ramda functions, the map(parseInt) trap and debugging with tap.
- 12 Currying and asynchrony (evolution)
Currying in asynchronous JavaScript: specialized request functions and a pipeAsync that waits for promises by itself and sends every error to a single catch.
- 13 Recursion
Base and recursive cases in JavaScript, stack overflow in deep recursion, why not to rely on tail calls, and how a trampoline keeps the stack from growing.
- 14 The map, filter, and reduce functions
What map, filter and reduce do in JavaScript, how reduce emulates the other two, and how to write all three with a loop, declaratively and via a trampoline.
- 15 Performance
Where the performance gap between functional JavaScript and a for loop comes from, why one measurement proves nothing, and when imperative code is worth it.
- 16 Memoization
Memoization in JavaScript: caching pure function results in a closure, cache keys, Ramda's R.memoizeWith, recursive Fibonacci, memory cost and invalidation.
- 17 Transducers
Transducers in JavaScript: map and filter without intermediate arrays, reducers and reducer transformers, step order in R.compose, R.transduce and R.into.
- 18 Lenses
How JavaScript lenses read and update nested data without mutation: view, set and over from Ramda, and your own lens built from a getter and a setter.
- 19 Side effects in function composition
How to add a side effect to a JavaScript function composition without breaking the chain: tap for logging pipe steps and for actions the program needs.
- 20 Category theory
Category theory basics for JavaScript developers: types as objects, functions as morphisms, and the composition laws of identity and associativity.
- 21 Functors and their laws
Functors in JavaScript: a container whose map keeps the structure. Arrays and a Maybe-like container, the functor laws and why a promise breaks composition.
- 22 Fantasy-land
What the Fantasy Land specification describes and how to implement a JavaScript functor with fantasy-land/map that obeys the identity and composition laws.
- 23 Maybe and Either
Maybe and Either in JavaScript with Sanctuary: reading nested data safely, errors with a reason instead of exceptions, and when to use map or chain.
- 24 Neural networks and category theory
A feedforward neural network as JavaScript function composition: neurons, layers, ReLU, why nonlinearity matters, and what category theory describes here.
- 25 FP in TypeScript and Effect
From JavaScript to TypeScript and Effect 4: pipe and Option instead of Maybe, Result instead of Either, typed errors, Schema, and where Effect pays off.
- 26 How to choose an FP library
How to choose a library for FP in JavaScript and TypeScript: Vanilla JS, Lodash, Ramda, Sanctuary, fp-ts or Effect, by budget, stage, team and quality.