What problem does it solve?
It solves the problem of building large, monolithic or poorly separated Effect codebases by guiding you to implement each capability as a small, composable Effect service with clear dependency wiring.
Core Features & Use Cases
- Namespace-module service structure: Keep
Interface, Service tag, layer, and (optionally) defaultLayer together for an explicit service graph.
- Dependency-safe construction: Use
Layer.effect with captured dependencies via yield*, while ensuring service method Requirements stay as never (no requirement leakage).
- Production composition by default: Build
defaultLayer via Layer.provide so wiring is straightforward, testable, and maintainable.
- Capability-based design: Split features into single-responsibility services like repositories, gateways, coordinators, and run-state.
- Testing-friendly layers: Promote implementation details into layers so you can swap behavior using
Layer.succeed or Layer.mock.
Quick Start
Implement your capability as a namespace that defines an Interface, an empty Context.Service tag, a layer built with Layer.effect and Effect.gen, and a defaultLayer that wires in dependencies with Layer.provide only when needed.