nw-fp-principles

Solid

Core functional programming thinking patterns and type system foundations, language-agnostic

DevOps & Infrastructure 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 Principles Core functional programming thinking patterns. Language-agnostic. Cross-references: [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [fp-hexagonal-architecture](../nw-fp-hexagonal-architecture/SKILL.md) | [fp-algebra-driven-design](../nw-fp-algebra-driven-design/SKILL.md) --- ## 1. Higher-Order Functions as Problem Decomposition [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. **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. --- ## 2. Type-Driven Design [STARTER] Write the type signature before implementation. The type tells you what the functi...

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