Skip to content

Rename parser Error and Warning types

This commit renames parser's Error and Warning types (and their constructors) to have a Ps prefix, so that this would play nicely when more errors and warnings for other phases of the pipeline will be added. This will make more explicit which is the particular type of error and warning we are dealing with, and will be more informative for users to see in the generated Haddock.

While this MR might feel like unnecessary churning, it's actually important in the optic of my upcoming work on Structured Errors, because as we will be adding more errors and warning types for the other phases of the compilation pipeline, if we keep naming everything just Error and Warning and we resolve ambiguity via qualified imports, this would still be fine for the ctags-centric developer, but would create unnecessary confusion when these types will be exposes as part of any top-level function, as this won't be rendered qualified in Haddock and the user would have to click on the hyperlink to know which error is which.

Plus, I think that being explicit rather than implicit in a large codebase like GHC is a good idea regardless.

To give you some more data points, I have actually tried keeping the names all the same as part of my work-in-progress branch but concluded that the explicit,prefix-based naming is actually preferable.

Merge request reports