General Functional Programming Guidelines
Core principles
- Prefer module-level functions over classes; pass context explicitly; avoid inheritance.
- Favor immutable data and pure functions; no global or shared mutable state.
- Compose complex behavior from small, focused functions.
Gotchas
- Closures over mutable state look pure but aren't: referential transparency requires both inputs and captured environment to be immutable
- Partial application order matters:
flipexists because curry direction is opinionated, not arbitrary