← ClaudeAtlas

functionallisted

Pure-by-default, errors as values (Result<T, E>), discriminated unions for state, immutability defaults, functional core / imperative shell. Side effects at adapters. Use for data flow or state.
voidcorp-core/void-harness · ★ 0 · Code & Development · score 76
Install: claude install-skill voidcorp-core/void-harness
# functional — voidcorp craftsman edition The domain decides in pure code. The world translates in adapters. Expected failures are values, not exceptions. Choices are types, not flags. Immutability is the default; mutation earns its place. This is `hexagonal-architecture`'s boundary viewed through a different lens — Bernhardt's functional core / imperative shell. Inside the hexagon: pure. At the adapters: effects. **Attribution**: see `.source` in this directory. Foundation: Wlaschin "Domain Modeling Made Functional," Mark Seemann "Code That Fits in Your Head," Bernhardt "Functional Core, Imperative Shell," Khorikov. --- ## Pure by default A function is **pure** if (a) same input → same output, (b) no observable side effects. Most domain logic should be pure. Side effects (DB writes, network calls, logging, time, randomness) live at adapter boundaries — outside the pure core. ### Pure-in-effect An async function that only `await`s injected ports is pure-in-effect: deterministic given the same ports. This is the practical equivalent of pure code in an async TS context. ### Red Flag — side effect inside a "pure" function ```typescript function calculateInvoice(order: Order): Invoice { const id = randomUUID(); // RED FLAG — impure const at = Date.now(); // RED FLAG — impure fetch('https://analytics/...'); // RED FLAG — side effect return { id, at, ... }; } ``` Fix: inject the ports. ```typescript function calculateInvoice(