summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Feuer <david.feuer@gmail.com>2017-04-01 11:12:31 -0400
committerDavid Feuer <David.Feuer@gmail.com>2017-04-01 11:20:49 -0400
commit83ac462449d9365ebd8b51f252f9cf81b35f119d (patch)
treebe3b6cf4743fa9b6a93eebc0438dff0fb0963218
parent616a3b49f085c01ff676424a1c3297ce0888e7ae (diff)
downloadhaskell-83ac462449d9365ebd8b51f252f9cf81b35f119d.tar.gz
Don't derive showList
There's no obvious reason to derive the definition of `showList`, manually inlining the default definition. Let's just use the default definition in the usual manner. Garbage collect a few unused `RdrNames` from `PrelNames`: `showList`, `showList__`, and `/=`. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3403
-rw-r--r--compiler/prelude/PrelNames.hs7
-rw-r--r--compiler/typecheck/TcGenDeriv.hs6
-rw-r--r--testsuite/tests/deriving/should_compile/drv-empty-data.stderr1
3 files changed, 3 insertions, 11 deletions
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index e3ebd6a4a2..94c2d64f7f 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -622,11 +622,10 @@ forall_tv_RDR, dot_tv_RDR :: RdrName
forall_tv_RDR = mkUnqual tvName (fsLit "forall")
dot_tv_RDR = mkUnqual tvName (fsLit ".")
-eq_RDR, ge_RDR, ne_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR,
+eq_RDR, ge_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR,
ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName
eq_RDR = nameRdrName eqName
ge_RDR = nameRdrName geName
-ne_RDR = varQual_RDR gHC_CLASSES (fsLit "/=")
le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=")
lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<")
gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">")
@@ -755,10 +754,8 @@ reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset")
prec_RDR = varQual_RDR rEAD_PREC (fsLit "prec")
pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail")
-showList_RDR, showList___RDR, showsPrec_RDR, shows_RDR, showString_RDR,
+showsPrec_RDR, shows_RDR, showString_RDR,
showSpace_RDR, showCommaSpace_RDR, showParen_RDR :: RdrName
-showList_RDR = varQual_RDR gHC_SHOW (fsLit "showList")
-showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__")
showsPrec_RDR = varQual_RDR gHC_SHOW (fsLit "showsPrec")
shows_RDR = varQual_RDR gHC_SHOW (fsLit "shows")
showString_RDR = varQual_RDR gHC_SHOW (fsLit "showString")
diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs
index d21535ee2b..96513da376 100644
--- a/compiler/typecheck/TcGenDeriv.hs
+++ b/compiler/typecheck/TcGenDeriv.hs
@@ -1112,12 +1112,8 @@ Example
gen_Show_binds :: (Name -> Fixity) -> SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff)
gen_Show_binds get_fixity loc tycon
- = (listToBag [shows_prec, show_list], emptyBag)
+ = (unitBag shows_prec, emptyBag)
where
- -----------------------------------------------------------------------
- show_list = mkHsVarBind loc showList_RDR
- (nlHsApp (nlHsVar showList___RDR) (nlHsPar (nlHsApp (nlHsVar showsPrec_RDR) (nlHsIntLit 0))))
- -----------------------------------------------------------------------
data_cons = tyConDataCons tycon
shows_prec = mkFunBindSE 1 loc showsPrec_RDR (map pats_etc data_cons)
comma_space = nlHsVar showCommaSpace_RDR
diff --git a/testsuite/tests/deriving/should_compile/drv-empty-data.stderr b/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
index 502ba6c572..47d5a984ab 100644
--- a/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
+++ b/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
@@ -9,7 +9,6 @@ Derived class instances:
instance GHC.Show.Show (DrvEmptyData.Void a) where
GHC.Show.showsPrec _ = GHC.Err.error "Void showsPrec"
- GHC.Show.showList = GHC.Show.showList__ (GHC.Show.showsPrec 0)
instance GHC.Classes.Ord (DrvEmptyData.Void a) where
GHC.Classes.compare _ _ = GHC.Err.error "Void compare"