root@fp-insights:~$

> FP Insights

An interactive deep-dive into Functional Programming in Scala — recommended by Boris (Anthropic CEO).
This is NOT a Scala book. These concepts apply in Python, JavaScript, Go, Rust — any language.

10 concepts · Plain English · Interactive demos · Quizzes · Jargon glossary
CHOOSE A CONCEPT
CONCEPT 01 · FOUNDATIONS
Referential Transparency
The one rule that makes code easy to test, debug, and reason about.
corepure functionstesting
CONCEPT 02 · FOUNDATIONS
Pure Core / Thin Shell
The architecture that makes complex software testable with zero mocks.
architecturetestingdesign
CONCEPT 11 · FOUNDATIONS
Immutable Data & Structural Sharing
Why immutable data structures are fast, safe, and enable time-travel debugging.
immutabilitydata structuressharing
CONCEPT 03 · FOUNDATIONS
Errors as Values
How Option/Result/Either make error handling composable and visible.
optionresulterror handling
CONCEPT 04 · FOUNDATIONS
Laziness & Pipeline Fusion
How lazy evaluation fuses pipelines and enables infinite sequences.
streamsgeneratorsperformance
CONCEPT 05 · FOUNDATIONS
State as a Return Value
The pattern behind Redux, React's useReducer, and testable state machines.
statereduximmutability
CONCEPT 12 · DESIGN
API-First Design
The FP method for designing libraries: start from ideal usage, derive types and laws.
designapilibrary design
CONCEPT 13 · DESIGN
Laws as Design Tools
Every abstraction has laws. Testing them as properties catches bugs that code review misses.
lawsproperty testingcorrectness
CONCEPT 06 · DESIGN
Property-Based Testing
Specify invariants; the framework generates hundreds of random test cases.
testinghypothesisquickcheck
CONCEPT 07 · ABSTRACTIONS
Monoids & Associativity
Why associativity unlocks free parallelism in MapReduce, Spark, and more.
monoidparallelismaggregation
CONCEPT 14 · ABSTRACTIONS
Functor — Map Everything
The simplest context-aware abstraction. Arrays, Promises, Options are all functors.
functormapcontext
CONCEPT 08 · ABSTRACTIONS
The Monad Pattern
The pattern behind Promises, async/await, optional chaining, and Result types.
monadflatmapchaining
CONCEPT 09 · ABSTRACTIONS
Applicative vs Monad
When to use Applicative (parallel/collect-all) vs Monad (sequential/fail-fast).
applicativevalidationparallel
CONCEPT 10 · EFFECTS & IO
Description vs Execution
The FP strategy for IO, streaming, and all side effects. SQL and React already do this.
ioeffectsstreaming
CONCEPT 15 · EFFECTS & IO
Trampolining & Stack Safety
How to make any recursive algorithm stack-safe by returning thunks instead of calling.
recursionstack safetyperformance
CONCEPT 16 · EFFECTS & IO
Stream Processing
Composable state machines that transform data streams with constant memory and resource safety.
streamingiocomposability