Skip to content

Smooth out the differences between `compiler/utils/Pretty.hs` and `libraries/pretty`

GHC has an internal copy of pretty in compiler/utils/Pretty.hs.

Todo:

  • refactor GHC's copy to make it as similar as possible to pretty, without making any real code changes.
  • apply the bug fixes that pretty received to GHC's copy, making sure not to pick up any possible new bugs in the process.

According to (1):

"There is one situation where the laws for pretty are ambiguous and leave room for choice. GHC decided one way and pretty the other."

  • Find which law that is, and document the differences.

This hopefully allows us to close the following tickets for free: #1062 (closed), #1176 (closed) and #7666 (closed), maybe more.

Ideally we could remove GHC's copy altogether, but we're not there yet. GHC's copy uses FastString, which is supposedly needed for performance, whereas pretty uses String.

(1) https://github.com/haskell/pretty/issues/1

Trac metadata
Trac field Value
Version 7.0.1
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related #1062 (closed), #1176 (closed), #7666 (closed)
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information