[commit: ghc] master: Don't derive showList (83ac462)

git at git.haskell.org git at git.haskell.org
Sat Apr 1 15:21:45 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/83ac462449d9365ebd8b51f252f9cf81b35f119d/ghc

>---------------------------------------------------------------

commit 83ac462449d9365ebd8b51f252f9cf81b35f119d
Author: David Feuer <david.feuer at gmail.com>
Date:   Sat Apr 1 11:12:31 2017 -0400

    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


>---------------------------------------------------------------

83ac462449d9365ebd8b51f252f9cf81b35f119d
 compiler/prelude/PrelNames.hs                                 | 7 ++-----
 compiler/typecheck/TcGenDeriv.hs                              | 6 +-----
 testsuite/tests/deriving/should_compile/drv-empty-data.stderr | 1 -
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index e3ebd6a..94c2d64 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 d21535e..96513da 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 502ba6c..47d5a98 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"



More information about the ghc-commits mailing list