Haskell has the largest gap between code that compiles and code that's actually idiomatic of any mainstream language. The type system is powerful enough that AI can generate Haskell that type-checks but uses head on empty lists, catches errors with error "" , and avoids the very abstractions that make Haskell valuable.
A CLAUDE.md at your project root tells the AI which Haskell you're writing. Here are 13 rules with the highest impact.
Rule 1: GHC version and language extensions
GHC version: 9.6+ (GHC2021 language set or explicit extensions). Enable these extensions in package.yaml or cabal file (not per-file pragmas except for unusual cases): OverloadedStrings, ScopedTypeVariables, LambdaCase, TupleSections, DeriveFunctor, DeriveGeneric, GeneralizedNewtypeDeriving, FlexibleInstances, FlexibleContexts
Do NOT enable: PartialTypeSignatures (forces you to complete type signatures).…