nw-fp-algebra-driven-design

Solid

Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations

Web & Frontend 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# FP Algebra-Driven Design Algebraic thinking for API design. Discover the right API before implementing by specifying rules (equations) that operations must satisfy. Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [fp-usable-design](../nw-fp-usable-design/SKILL.md) --- ## 1. Why Algebraic Thinking [STARTER] Code is the wrong abstraction level for design. Starting with data structures inherits unnecessary constraints. - **Specify rules first, implement second.** Implementation is a solution to a system of equations. - **Rules generate tests automatically.** Every rule is directly a property test generating thousands of cases. - **Rules reveal missing features.** Analysis often exposes operations you need but haven't designed. - **Rules catch contradictions early.** Contradiction during design costs minutes; in production, days. --- ## 2. The Design Process [STARTER] 1. **Start with scope, not implementation.** Don't decide data structures upfront. 2. **Define observations first.** How do users extract information? Observations define equality: two values equal if no observation distinguishes them. Gives enormous implementation freedom. 3. **Add operations incrementally.** For each new operation, immediately write rules connecting it to existing ones. This web of rules IS the design. 4. **Let messy rules signal problems.** Complex rules mean coarse building blocks. Decompose until each rule ...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category