effects

Design OCaml 5 algebraic effects-based APIs and streaming components with Eio or affect.

35|9|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/avsm/ocaml-claude-marketplace --skill effects-avsm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effects
Source: https://github.com/avsm/ocaml-claude-marketplace/tree/main/plugins/ocaml-dev/skills/effects
Command: npx skills add https://github.com/avsm/ocaml-claude-marketplace --skill effects-avsm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OCaml 5 algebraic effects design patterns help developers build robust effectful APIs and streaming components by cleanly separating suspension from errors, enabling layered designs and easier testing and composition.

Core Features & Use Cases

  • Layered design guidance: source handles suspension; protocol parsers remain effect-free and easier to test.
  • Integration patterns with Eio and affect libraries to enable deterministic scheduling and fiber cooperation.
  • Guidance on when to use effects versus exceptions across API boundaries and streaming components.
  • Practical patterns for building effectful readers/sources and handlers with clear separation of concerns.

Quick Start

Study an end-to-end example showing how to model a simple input stream using OCaml 5 effects and an Eio-backed source.

Frequently Asked Questions about effects

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

FAQPage Schema
How do I design OCaml 5 algebraic effects for streaming components?

Design OCaml 5 algebraic effects by cleanly separating suspension from errors, enabling layered architectures where sources handle suspension and protocol parsers remain effect-free for easier testing and composition.

When should I use effects versus exceptions in OCaml 5 API boundaries?

Use effects versus exceptions in OCaml 5 based on streaming requirements: effects manage suspension and scheduling, while exceptions handle unrecoverable errors, ensuring clear separation of concerns across API boundaries.

How do I integrate OCaml 5 effects with Eio or affect for deterministic scheduling?

Integrate OCaml 5 effects with Eio or affect using specific patterns that enable deterministic scheduling and fiber cooperation, modeling input streams with Eio-backed sources for robust effectful readers and handlers.

What is the best way to layer responsibilities in effectful OCaml 5 APIs?

Layer responsibilities in effectful OCaml 5 APIs by assigning suspension handling to sources and keeping protocol parsers effect-free, which simplifies testing and composition of streaming components.

Can I keep protocol parsers effect-free while using OCaml 5 algebraic effects?

Yes, you can keep protocol parsers effect-free by adopting a layered design where effectful sources handle suspension, allowing parsers to remain pure, testable, and decoupled from effect schedulers.

Why does separating suspension from errors matter in OCaml 5 streaming code?

Separating suspension from errors in OCaml 5 streaming code matters because it prevents scheduling states from being confused with failures, enabling robust layered designs and easier composition of effectful components.