on master help sign in
Defer inlining of Data.Text.length

Otherwise it may be inlined before the compareLength rewrite rules have a change to fire.

commit0cf7d06b6a8acdba19d5a62f9e1f96b3ad0cea29 authorBen Gamari <ben@smart-cactus.org> dateTue 29 Mar 2016, 19:38 (11 years ago) parent18f9a7b
1 file changed+3−1
Data/Text.hs+3−1
Data/Text.hs+3−1
@@ -571,7 +571,9 @@ isSingleton = S.isSingleton . stream
571571-- Subject to fusion.
572572length :: Text -> Int
573573length t = S.length (stream t)
574−{-# INLINE length #-}
574+{-# INLINE [0] length #-}
575+-- length needs to be phased after the compareN/length rules otherwise
576+-- it may inline before the rules have an opportunity to fire.
575577
576578-- | /O(n)/ Compare the count of characters in a 'Text' to a number.
577579-- Subject to fusion.