parse-dont-validate

Installation
SKILL.md

Parse, Don't Validate

Parse raw input into domain values before effects depend on valid input. Make downstream functions consume those values instead of repeating checks on primitives.

Model the invariant

  • Identify the invariant that the consumer requires.
  • Choose a representation that preserves the invariant.
  • Trace callers to the input boundary.
  • Refine a value when a constraint applies only to one branch.
  • Introduce a type only when it prevents a concrete error or expresses a domain distinction.
  • Name each type for the guarantee that it establishes.

In F#, use records for values that must exist together. Use discriminated unions for alternatives or state-specific data.

Use distinct types when exchanging two primitive values would cause an error. Reuse suitable domain types.

Use constrained types for range or format guarantees. Enforce smart constructors through private representations or .fsi signatures.

Installs
15
GitHub Stars
21
First Seen
Oct 13, 2026