Skip to content

Convert codebase to use modern Haskell records #578

Description

@simonmar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions