arrow-typed-errors

Model Kotlin domain failures with Arrow's Raise DSL and typed wrappers.

61|3|Updated Mar 1, 2024
One-click install
npx skills add https://github.com/alexandru/social-publish --skill arrow-typed-errors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arrow-typed-errors
Source: https://github.com/alexandru/social-publish/tree/main/.agents/skills/arrow-typed-errors
Command: npx skills add https://github.com/alexandru/social-publish --skill arrow-typed-errors

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Models Kotlin logical failures with Arrow's context-parameter Raise DSL and wrappers such as Either, nullable, Option, and Ior. Use when implementing or simplifying typed-error flows, translating error types, replacing verbose Either handling, validating input with accumulation, or selecting an error wrapper.

Core Features & Use Cases

  • Distinguish domain failures from exceptional faults before selecting an API.
  • For dependent multi-step logic, use context-parameter computations and translate errors at boundaries.
  • Leverage wrappers like Either, Nullable/Option, Ior to model failure and success, or accumulate independent defects for richer validation.

Quick Start

Ask your AI to implement a Kotlin function that uses Arrow's Raise context to parse input, validate it, and propagate typed errors across layers.

Frequently Asked Questions about arrow-typed-errors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I model typed errors in Kotlin using Arrow's Raise context?

To model typed errors with Arrow's Raise context, define domain-specific failures within context-parameter computations and use wrappers like Either, Option, or Ior to propagate them across multi-step workflows.

What is the difference between domain failures and exceptional faults in Kotlin typed error handling?

Domain failures are expected logical errors modeled by typed wrappers like Either and Ior, whereas exceptional faults are unexpected runtime crashes. Distinguishing them before selecting an API ensures correct error propagation strategy.

How do I accumulate validation errors in Kotlin instead of failing fast?

To accumulate validation errors in Kotlin, use Arrow's Ior wrapper within the Raise DSL to collect independent defects across input validation steps, providing richer error reporting rather than stopping at the first failure.

Can I translate error types across boundaries in nested Kotlin computations with Arrow?

Yes, you can translate error types across boundaries in nested Kotlin computations by leveraging Arrow's context-parameter API to map and propagate different typed errors through dependent multi-step logic layers.

When should I use Either versus Option or Ior for Kotlin typed errors?

Use Either to model success or specific failure, Option for presence or absence, and Ior when you need to accumulate independent defects for richer validation while continuing computation across multi-step workflows.

Does Arrow's context-parameter API work for replacing verbose Either handling in Kotlin?

Yes, Arrow's context-parameter API simplifies verbose Either handling by allowing typed errors to be raised contextually, reducing boilerplate when propagating failures across nested computations and boundary translations.