OCaml 5 effects skill for Claude Code: Design a streaming reader
Design streaming code with suspension at the data source and a plain input interface for the parser. This makes it easier to test parsing with in-memory data.
中文Install in Claude Code
Use Claude Code with an OCaml 5 example. Running an implementation that uses Eio or affect requires the corresponding library.
- Download the repository snapshot at the linked commit. Copy plugins/ocaml-dev/skills/effects/ into .claude/skills/effects/ in your practice project and keep its reference files.
- Check that SKILL.md is directly inside .claude/skills/effects/. Open Claude Code from the project root.
- Enter /effects to try the example below.
Example task
Run /effects and describe a two-byte length header. Compare bytes arriving in separate chunks, a delay before byte two, and a permanent end after byte one. Ask for an interface and test design.What to check
The design waits for delayed data at the source and treats a permanently truncated header as a separate case. It includes tests for both outcomes.
Original SKILL.md on GitHub · Updated
Frequently asked question
Where should a streaming reader wait for the next chunk?
Let the data source handle waiting. The parser reads through the interface and can be tested against complete and truncated input.