Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explains core functional programming patterns, including map, filter, fold, and type system foundations, in a language-agnostic way.
77% 86%+9 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 17 of 22 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Core functional programming thinking patterns. Language-agnostic.
Cross-references: fp-domain-modeling | code-craftsmanship: FP Hexagonal Architecture | fp-algebra-driven-design
[STARTER]
Three operations replace most loops:
| Operation | Purpose | Replaces |
|---|---|---|
| Map | Transform each element, preserve structure | Loop building new collection |
| Filter | Keep elements matching condition | Loop with conditional |
| Fold | Accumulate elements into single result | Loop with running total |
When to use Map: Transform every element without changing collection shape. Nested maps handle nested structures. When to use Filter: Select elements without changing their values. When to use Fold: Reduce collection to single value. Accumulator IS your state. Combining function IS your state transition. Folds make state machines explicit.
Dependent streams: Fold over the evolving descriptive state, not the initial
state for every item. Approve then archive an invoice uses the post-approval
invoice; snapshots project only the final register. Law:
prepare(s, xs ++ ys) = prepare(prepare(s, xs), ys) on admitted transitions.
When refusal forbids construction activity, load nw-certainty-by-construction
for its readiness boundary before execution. Basis: Sandy Maguire,
Algebra-Driven Design, Designing Algebras → Scavenger Hunt → A Unified
Observation; Thinking with Types, Indexed Monads → Definition and Necessary
Machinery.
Decision: "Am I transforming, selecting, or accumulating?" Pick matching operation. If none fit, compose two.
Why: These operations communicate intent. Map says "same shape, different values." Fold says "many inputs, one output." Loops say nothing about intent until you read every line.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.