summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-09-28 14:26:00 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-02 05:20:29 -0400
commit4bdafb48b40afd1eb185c1312302e5759f796472 (patch)
treea109c1d4677f56320d5d60d4212a0c3291c49ba4
parent040c347e3cc968d37e76bca228f1f5df997d3672 (diff)
downloadhaskell-4bdafb48b40afd1eb185c1312302e5759f796472.tar.gz
Add (++)/literal rule
When we derive the Show instance of the big record in #16577, I get the following compilation times (with -O): Before: 0.91s After: 0.77s Metric Decrease: T19695
-rw-r--r--libraries/base/GHC/Base.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index f0f14877c8..b80fa3d349 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -1388,6 +1388,11 @@ The rules for map work like this.
(++) (x:xs) ys = x : xs ++ ys
{-# RULES
+"++/literal" forall x. (++) (unpackCString# x) = unpackAppendCString# x
+"++/literal_utf8" forall x. (++) (unpackCStringUtf8# x) = unpackAppendCStringUtf8# x
+#-}
+
+{-# RULES
"++" [~1] forall xs ys. xs ++ ys = augment (\c n -> foldr c n xs) ys
#-}