nw-fp-hexagonal-architecture

Solid

Hexagonal architecture patterns with pure core and side-effect shell for functional codebases

AI & Automation 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 Hexagonal Architecture Ports and adapters in functional programming. Structure applications with a pure core and side-effect shell. 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. The Natural Fit [STARTER] Functional architecture naturally implements ports and adapters. The paradigm's separation of pure functions from side effects IS the hexagonal boundary. | OOP Concept | FP Equivalent | Why | |---|---|---| | Port (interface) | Function type signature / type alias | Port defines contract; function signature IS that contract | | Adapter (class) | Concrete function implementation | Adapter fulfills contract; matching function does same | | DI container | Function parameters / partial application | Dependencies passed as arguments, no container needed | | Domain service class | Module of pure functions | Related pure functions replace stateful service object | | Entity with behavior | Immutable data + functions operating on it | Data and behavior separated; functions transform immutable values | --- ## 2. Pure Core / Side-Effect Shell [STARTER] All business logic is pure; all side effects live at the system's edges. **The Sandwich Pattern**: Read (impure) -> Decide (pure) -> Write (impure) ``` +--------------------------------------------------+ | Side-Effect Shell (thin) | | - HTTP handlers, CLI, me...

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