skills/alexandru/skills/arrow-resource

arrow-resource

SKILL.md

Arrow Resource (Kotlin)

Quick start

  • Use resourceScope { ... } at lifecycle boundaries.
  • Define each resource with resource { install(acquire) { a, exitCase -> release } }.
  • Compose with .bind(); use parZip for independent parallel acquisition.
  • Read references/resource.md for patterns and concrete examples.

Workflow

  1. Identify the acquire step and the release step.
  2. Implement a Resource<A> using install.
  3. Create reusable constructors on ResourceScope when needed.
  4. Compose resources into higher-level resources with .bind().
  5. Execute in resourceScope and keep finalizers idempotent.

Usage guidance

  • Prefer Resource over use/try/finally when you need suspend finalizers or MPP support.
  • Use ExitCase to handle rollback/cleanup differences.
  • When mixing with typed errors, pick nesting order deliberately to control ExitCase seen by finalizers.

References

  • Load references/resource.md for API details and end-to-end examples.
Weekly Installs
8
GitHub Stars
22
First Seen
Feb 1, 2026
Installed on
claude-code8
github-copilot8
opencode7
gemini-cli6
codex6
kilo5