Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Describes hexagonal architecture for functional codebases, separating a pure core from a side-effect shell with ports and adapters.
86% 77%−9 ptsof test cases passed
Passed 17 of 22 test cases with the skill, and 19 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
File and folder layout of the core, ports and adapters follows the File layout section of nw-code-craftsmanship.
Ports and adapters in functional programming. Structure applications with a pure core and side-effect shell.
Cross-references: fp-principles | fp-domain-modeling | fp-usable-design
[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 |
[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, message consumers |
| - Database access, file I/O, network calls |
| - Reads data, calls core, writes results |
| |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.