arrow-typed-errors

Installation
SKILL.md

Arrow Typed Errors (Kotlin)

Quick start

  • Classify the failure first: logical failure (typed error) vs exceptional failure (exception).
  • Pick the surface type:
    • Raise<E> + builder (either {}/option {}/nullable {}) for composable logic.
    • Wrapper type (Either/Option/Ior/Result/nullable) for API boundaries.
  • Read references/typed-errors.md for API details and patterns before coding if unsure.

Workflow

  1. Model errors as sealed types.
  2. Implement happy-path logic with Raise DSL (prefer either {} or nullable {} depending on output).
  3. Guard invariants with ensure / ensureNotNull.
  4. Interop with external code:
    • Use catch/Either.catchOrThrow to convert expected exceptions into typed errors.
  5. Compose with .bind() and transform errors with withError or recover.
  6. For validation across fields or lists, use accumulation (zipOrAccumulate, mapOrAccumulate, or accumulate).
  7. Expose wrapper types at module boundaries; keep Raise internally when possible.
Related skills

More from alexandru/skills

Installs
16
GitHub Stars
39
First Seen
Feb 1, 2026