fsharp-iwsam-errors

Installation
SKILL.md
Contains Shell Commands

This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.

F# IWSAM error trees

A leaf function declares its errors as an interface with static abstract members and returns Result<_, 'e> when 'e :> LeafError<'e>. Composites in a result block pick up the union of their leaves' constraints with no Result.mapError. The caller at the edge picks one concrete type that implements every interface the tree needs. The gist that started this: https://gist.github.com/TheAngryByrd/ceb18e5b219458084f6c156b538ba579. A runnable proof with seven edge shapes and four compile-time break tests lives in scripts/. Read references/FINDINGS.md for output you can compare against.

Rules

  • A payload is a typed value. A string appears in an error only when it comes from outside the domain: the raw input that failed to parse, named raw, or a message an external library or call returned, named for its source.
  • A domain value with a format rule gets a private constructor and a parse function. That parse is itself a leaf.
  • One interface per source of failure. Name the parse leaf after the failure: InvalidSku, UnparsedEmail.
  • A bundle interface that inherits several leaves is implementer convenience. Inference never names it. Add one only when several edge types implement the same set.
  • Put #nowarn "3535" at file top, or pass --nowarn:3535 to dotnet fsi. The in-file directive does not silence the main script under dotnet fsi.
  • A leaf that also takes a capability env as #IProvideX must name 'env in its explicit type parameters: <'env, 'e when 'env :> IProvideX and X<'e>>. The fsharp-env-capabilities skill records the FS0064 failure.
Installs
15
GitHub Stars
21
First Seen
Oct 13, 2026