Glean
Glean copied to clipboard
Convert codebase to use modern Haskell records
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 thatRecordWildCardsmakes it hard to follow what's going on because it makes binding sites opaque. -
DuplicateRecordFieldsandNoFieldSelectors. 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 usingNamedFieldPunsis acceptable.
I've been playing around with making these changes with the help of AI, I'll put some diffs up soon.