• Ryan Scott's avatar
    Fix #15039 by pretty-printing equalities more systematically · 99f8cc84
    Ryan Scott authored
    GHC previously had a handful of special cases for
    pretty-printing equalities in a more user-friendly manner, but they
    were far from comprehensive (see #15039 for an example of where this
    fell apart).
    
    This patch makes the pretty-printing of equalities much more
    systematic. I've adopted the approach laid out in
    https://ghc.haskell.org/trac/ghc/ticket/15039#comment:4, and updated
    `Note [Equality predicates in IfaceType]` accordingly. We are now
    more careful to respect the properties of the
    `-fprint-explicit-kinds` and `-fprint-equality-relations` flags,
    which led to some improvements in error message outputs.
    
    Along the way, I also tweaked the error-reporting machinery not to
    print out the type of a typed hole when the type is an unlifted
    equality, since it's kind (`TYPE ('TupleRep '[])`) was more
    confusing than anything.
    
    Test Plan: make test TEST="T15039a T15039b T15039c T15039d"
    
    Reviewers: simonpj, goldfire, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15039
    
    Differential Revision: https://phabricator.haskell.org/D4696
    99f8cc84
T15039d.stderr 2.78 KB