Fix inconsistent pretty-printing of type families
authorMichał Sośnicki <sosnicki.michal@gmail.com>
Wed, 18 Nov 2015 15:02:53 +0000 (16:02 +0100)
committerBen Gamari <ben@smart-cactus.org>
Wed, 18 Nov 2015 16:31:20 +0000 (17:31 +0100)
commitc61759d5917996a10b06a286eb5b776e4069e35c
tree7fc3b9a29cec4f98e28278d23e5000743d0d3956
parent07eb258dfcbf8a67e4e931397128b7255356d19e
Fix inconsistent pretty-printing of type families

After the changes, the three functions used to print type families
were identical, so they are refactored into one.

Original RHSs of data instance declarations are recreated and
printed in user error messages.

RHSs containing representation TyCons are printed in the
Coercion Axioms section in a typechecker dump.

Add vbar to the list of SDocs exported by Outputable.
Replace all text "|" docs with it.

Fixes #10839

Reviewers: goldfire, jstolarek, austin, bgamari

Reviewed By: jstolarek

Subscribers: jstolarek, thomie

Differential Revision: https://phabricator.haskell.org/D1441

GHC Trac Issues: #10839
47 files changed:
compiler/basicTypes/DataCon.hs-boot
compiler/coreSyn/CoreLint.hs
compiler/deSugar/DsUtils.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsExpr.hs
compiler/iface/IfaceSyn.hs
compiler/iface/LoadIface.hs
compiler/nativeGen/Reg.hs
compiler/nativeGen/SPARC/Ppr.hs
compiler/typecheck/FamInst.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcValidity.hs
compiler/types/Class.hs
compiler/types/Coercion.hs
compiler/types/TypeRep.hs
compiler/utils/BooleanFormula.hs
compiler/utils/Outputable.hs
compiler/utils/Pretty.hs
testsuite/tests/ghci/scripts/T6018ghcifail.stderr
testsuite/tests/indexed-types/should_compile/T3017.stderr
testsuite/tests/indexed-types/should_compile/T9085.stderr
testsuite/tests/indexed-types/should_fail/NoGood.stderr
testsuite/tests/indexed-types/should_fail/Over.stderr
testsuite/tests/indexed-types/should_fail/SimpleFail11a.stderr
testsuite/tests/indexed-types/should_fail/SimpleFail11b.stderr
testsuite/tests/indexed-types/should_fail/SimpleFail11c.stderr
testsuite/tests/indexed-types/should_fail/SimpleFail11d.stderr
testsuite/tests/indexed-types/should_fail/SimpleFail2b.stderr
testsuite/tests/indexed-types/should_fail/T2334A.stderr
testsuite/tests/indexed-types/should_fail/T2677.stderr
testsuite/tests/indexed-types/should_fail/T3330b.stderr
testsuite/tests/indexed-types/should_fail/T4246.stderr
testsuite/tests/indexed-types/should_fail/T9371.stderr
testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
testsuite/tests/polykinds/T7524.stderr
testsuite/tests/roles/should_compile/Roles14.stderr
testsuite/tests/roles/should_compile/Roles3.stderr
testsuite/tests/roles/should_compile/Roles4.stderr
testsuite/tests/roles/should_compile/T8958.stderr
testsuite/tests/th/T6018th.stderr
testsuite/tests/typecheck/should_compile/T6018.stderr
testsuite/tests/typecheck/should_compile/tc231.stderr
testsuite/tests/typecheck/should_compile/tc265.stderr
testsuite/tests/typecheck/should_fail/T10836.stderr
testsuite/tests/typecheck/should_fail/T6018fail.stderr
testsuite/tests/typecheck/should_fail/T6018failclosed.stderr