Skip to content

WIP: Implement GHC proposal "Errors as Values"

Alfredo Di Napoli requested to merge adinapoli/ghc:adinapoli/error-adts into master

Nothing to see at the moment, merely running CI to get test feedback.

This is a WIP-branch of the work @alp started on the "Errors as Values" GHC Proposal. See also !3691 (closed), which this MR should eventually supersede. Everything is really in flux, but I wanted to have CI run the testsuite as I am getting some failures I'd like to understand if are related to my dev environment or genuine regressions.

The design and plan of this branch are discussed in:

tl;dr: this generalizes the existing error infrastructure a little bit, introduces error data types for the parser and TcRn, as well as a toplevel error sum type. This also moves a few existing errors (from the parser and renamer/typechecker) over to dedicated constructors of the subsystem error types, to give us an idea of how this design pans out in GHC's codebase and provide us with something to discuss and refine. I've made a few choices here and there that we might or might not run with, and we might want to introduce some less document-centric error utilities in a few places, like the typechecker.

Edited by Simon Peyton Jones

Merge request reports