summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs.hs
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2019-10-25 11:20:48 +0200
committerSebastian Graf <sebastian.graf@kit.edu>2019-10-25 17:15:43 +0200
commitbf053189060bacded949050f4efeeb279dc23cc4 (patch)
treeecda5e5bc78d0353d16eb57ffb0efa1ef6037030 /compiler/GHC/Hs.hs
parent6824f29aebd28571db118eb6877ef04eda630871 (diff)
downloadhaskell-wip/flexible-outputable.tar.gz
Use FlexibleInstances for `Outputable (* p)` instead of match-all instances with equality constraintswip/flexible-outputable
In #17304, Richard and Simon dicovered that using `-XFlexibleInstances` for `Outputable` instances of AST data types means users can provide orphan `Outputable` instances for passes other than `GhcPass`. Type inference doesn't currently to suffer, and Richard gave an example in #17304 that shows how rare a case would be where the slightly worse type inference would matter. So I went ahead with the refactoring, attempting to fix #17304.
Diffstat (limited to 'compiler/GHC/Hs.hs')
-rw-r--r--compiler/GHC/Hs.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Hs.hs b/compiler/GHC/Hs.hs
index aa345f1476..103539a41b 100644
--- a/compiler/GHC/Hs.hs
+++ b/compiler/GHC/Hs.hs
@@ -118,7 +118,7 @@ deriving instance Data (HsModule GhcPs)
deriving instance Data (HsModule GhcRn)
deriving instance Data (HsModule GhcTc)
-instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (HsModule p) where
+instance (OutputableBndrId p) => Outputable (HsModule (GhcPass p)) where
ppr (HsModule Nothing _ imports decls _ mbDoc)
= pp_mb mbDoc $$ pp_nonnull imports