Menu

Post image 1
Post image 2
1 / 2
0

CLAUDE.md for Haskell: 13 Rules That Make AI Write Idiomatic, Type-Safe Haskell

DEV Community·Olivia Craft·18 days ago
#4eeQ2DBd
#rule#haskell#claudemd#ai#fullscreen#type
Reading 0:00
15s threshold

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). Do NOT use extensions that enable unsafe operations unless documented.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More