Skip to content

Typecheck record update via desugaring

There are quite a few tickets relating to inadequacies of record update, including

Record update is a place where our general plan of typechecking the source syntax seems particularly hard to do. It wold be much easier (and correct by construction) to desugar (but still in HsSyn) and typecheck that.

Fortunately we now have a way to do that: our Re-engineer rebindable syntax ticket, #17582. A lot of attention is paid there to maintaining good error messages, which is the main challenge of this approach.

So this ticket is to propose: let's use the work on #17582 to solve our record-update tickets.

See also #21158 (closed) for why this will be a breaking change.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information