← ClaudeAtlas

haskell-documentationlisted

Write and enforce Haskell documentation with Haddock + Doctest. Covers the syntax cheat sheet (before/after declarations, records, sum types, module headers), the Haddock coverage gate (`-Wmissing-docs` and `haddock -Werror` do not exist on GHC 9.10.3 — use `scripts/check-haddock.sh`), executable examples via doctest, and how to keep docs from drifting from code. Use when adding documentation, configuring the doctest test-suite, deciding what to put in Haddock vs hspec, or debugging Haddock warnings.
ivelten/claude-haskell-skills · ★ 0 · Data & Documents · score 60
Install: claude install-skill ivelten/claude-haskell-skills
# Haskell Documentation **Haddock on every public binding is non-negotiable.** Every exported function, type, type constructor, data constructor, type class, type class method, and module gets a Haddock comment. Enforcement is a **Haddock coverage gate** (`scripts/check-haddock.sh`), not a compiler warning — see "Enforcement: what actually works" below before reaching for `-Wmissing-docs`. The discipline is not "document everything that exists" — it's "document everything users of the module see." Internal helpers, private functions, and instances of derived classes don't need it. The combined enforcement is what makes Haddock more than aspirational: coverage is verified by the gate script, examples run as tests (doctest), and unresolved cross-references fail that same script. ## Enforcement: what actually works Two flags are widely cited for this job and **neither exists on the pinned toolchain**. Verified on GHC 9.10.3 / Haddock 2.31.1 (2026-09): - **`-Wmissing-docs` is not a GHC warning.** GHC rejects it as `[GHC-93741] unrecognised warning flag`. Putting it in `ghc-options` is worse than useless: the build emits a warning about the flag itself on every compile, while documentation goes completely unenforced. GHC's nearest real flag is **`-Winvalid-haddock`**, which catches Haddock comments in positions where they attach to nothing — useful, but not a coverage check. Put that one in the library stanza instead. - **Haddock 2.31.1 has no `-Werror`.** `cabal haddock --h