Typed pipe and flow Utilities
Build left-to-right pipelines with accurate inference.
From compose to pipe
pipe threads a value through functions left to right, the reading order most people prefer. pipe(x, f, g) means g(f(x)).
A Two-Step pipe
The simplest pipe takes a value and one function, returning the result. Reading top to bottom matches execution order.
const pipe2 = <A, B>(a: A, f: (a: A) => B): B => f(a);
console.log(pipe2(5, n => n + 1)); // 6All lessons in this course
- Pure Functions and Immutability
- Currying and Partial Application
- Function Composition with Types
- Typed pipe and flow Utilities