Glean icon indicating copy to clipboard operation
Glean copied to clipboard

Convert codebase to use modern Haskell records

Open simonmar opened this issue 6 months ago • 2 comments

Now that GHC 9.2 is the lowest version we support, I think it would help maintainability a great deal if we switched to modern Haskell records. In particular:

  • Enable OverloadedRecordDot
  • No more RecordWildCards. This is convenient for the author, but very often we've heard from people new to the codebase that RecordWildCards makes it hard to follow what's going on because it makes binding sites opaque.
  • DuplicateRecordFields and NoFieldSelectors. Drop the convention that field names are prefixed with the name of the record and use either dot syntax (preferably) or pattern matching for selection. Pattern matching is necessary when the record has existentially quantified type variables; in that case using NamedFieldPuns is acceptable.

I've been playing around with making these changes with the help of AI, I'll put some diffs up soon.

simonmar avatar Aug 20 '25 09:08 simonmar