From ocaml-dev
Provides OCaml 5.x stdlib Result patterns: chains operations with let* via Result.Syntax, extracts Ok/Error values with get_ok/get_error, refactors local let* to Result.Syntax. For error handling.
npx claudepluginhub avsm/ocaml-claude-marketplace --plugin ocaml-devThis skill uses the workspace's default tool permissions.
OCaml 5.x provides `Result.Syntax` for monadic chaining and `Result.get_ok`/`Result.get_error` for extraction.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
OCaml 5.x provides Result.Syntax for monadic chaining and Result.get_ok/Result.get_error for extraction.
Use open Result.Syntax to get let* and let+ bindings:
open Result.Syntax
let process request =
let* req = validate request in
let* auth = authenticate req in
let* _ = authorize auth in
execute req
DO NOT define local let ( let* ) = Result.bind. Use open Result.Syntax instead.
| Function | Behavior on Error |
|---|---|
Result.get_ok r | Raises Invalid_argument |
Result.get_error r | Raises Invalid_argument |
Result.value r ~default | Returns default |
Use Result.get_ok only when failure is a programming error:
(* Startup/config - crash on failure is intentional *)
let config = Result.get_ok (Config.load ())
(* Test setup - failure means test bug *)
let client = Result.get_ok (Tls.Config.client ~authenticator ())
Only define custom get_ok when you need different exception behavior:
(* Raises domain-specific Protocol_error instead of Invalid_argument *)
let get_ok = function
| Ok x -> x
| Error e -> raise (Protocol_error e)
If you just want Invalid_argument, use Result.get_ok directly.