on master help sign in
Show: Activate literal rewrite rules in simplifier phase 2

Previously these RULES were quite fragile as they could compete with the `unpack` rule defined in `GHC.Base`. This was tickled by 7.10.2, which happened to rewrite the LHS of rules with other rules (which is itself a bug in GHC). This caused the literal rules to fail to fire, which then resulted in long compilation times. To avoid this sort of fragility, we would like the literal rules to fire very early in the simplifier. For this reason we set them to rule in phase 2. See GHC Trac #10528 for further discussion [1]. [1] https://ghc.haskell.org/trac/ghc/ticket/10528

commit86ddf8a9dd29d9548bec2e253f1793dc5f346a05 authorBen Gamari <bgamari.foss@gmail.com> dateMon 27 Jul 2015, 14:01 (11 years ago) parentb114f2a
1 file changed+4−4
Data/Text/Show.hs+4−4
Data/Text/Show.hs+4−4
@@ -50,19 +50,19 @@ unpackCString# :: Addr# -> Text
5050unpackCString# addr# = unstream (S.streamCString# addr#)
5151{-# NOINLINE unpackCString# #-}
5252
53−{-# RULES "TEXT literal" forall a.
53+{-# RULES "TEXT literal" [2] forall a.
5454 unstream (S.map safe (S.streamList (GHC.unpackCString# a)))
5555 = unpackCString# a #-}
5656
57−{-# RULES "TEXT literal UTF8" forall a.
57+{-# RULES "TEXT literal UTF8" [2] forall a.
5858 unstream (S.map safe (S.streamList (GHC.unpackCStringUtf8# a)))
5959 = unpackCString# a #-}
6060
61−{-# RULES "TEXT empty literal"
61+{-# RULES "TEXT empty literal" [2]
6262 unstream (S.map safe (S.streamList []))
6363 = empty_ #-}
6464
65−{-# RULES "TEXT singleton literal" forall a.
65+{-# RULES "TEXT singleton literal" [2] forall a.
6666 unstream (S.map safe (S.streamList [a]))
6767 = singleton_ a #-}
6868