Install any skill in seconds. Free to start, no credit card required.
Get Started Free →FP structure catalogue for API design: semigroups, monoids, semilattices, and interpreters, with the laws each must preserve.
77% 91%+14 ptsof test cases passed
Passed 20 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
FP structure catalogue for API design; derive candidate API/observations via
nw-algebraic-design-protocol. A crafter or reviewer uses the catalogue only to
implement or judge preservation of laws the bound design already declares;
deriving a new API, observation or law is DESIGN work returned to its owner.
Thin FP projection (ADR-SSOT-002 §6a). The design METHOD — how to find
observations, add constructors, and follow a contradiction to its carrier —
lives once in nw-algebraic-design-protocol and applies at every layer, not
just FP data types. This file's own contribution is narrower: the catalogue
of recurring FP structures (Section 2) and how they compose. Load the
protocol skill for the method; load this one for the structure catalogue.
Refs: fp-principles | fp-domain-modeling | code-craftsmanship: Usable Design for Algebraic APIs
[STARTER] -> [ADVANCED]
Recognizing recurring structures unlocks known rules/capabilities.
What: Type with one merge operation where grouping doesn't matter.
Rule: (a merge b) merge c = a merge (b merge c) (associativity)
When: Combining things where parenthesization shouldn't matter.
Examples: String concatenation | config merging | min/max.
What: Combinable Value with a default element inert under combination.
Rules: Associativity + default merge x = x and x merge default = x
When: Safe defaults | fold operations | "nothing happened yet" values.
Examples: (+, 0) | (*, 1) | (concat, []) | (and, true).
Design signal: If you find an associative operation, look for a default element. Finding one enables fold/reduce over collections.
Next to this one in the catalogue, plus more from the same author.