diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-09-28 14:26:00 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-02 05:20:29 -0400 |
commit | 4bdafb48b40afd1eb185c1312302e5759f796472 (patch) | |
tree | a109c1d4677f56320d5d60d4212a0c3291c49ba4 | |
parent | 040c347e3cc968d37e76bca228f1f5df997d3672 (diff) | |
download | haskell-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.hs | 5 |
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 #-} |