Skip to content

Commit 67ab7b2

Browse files
committed
Inline length in phase 1
There is a comment that > length needs to be phased after the `compareN/length` rules otherwise > it may inline before the rules have an opportunity to fire. but these rules are marked `[~1]`, so we can inline `length` in phase 1 to expose the `stream` in its definition and actually allow it to fuse.
1 parent d4da7fa commit 67ab7b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Data/Text.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ isSingleton = S.isSingleton . stream
605605
-- Subject to fusion.
606606
length :: Text -> Int
607607
length t = S.length (stream t)
608-
{-# INLINE [0] length #-}
608+
{-# INLINE [1] length #-}
609609
-- length needs to be phased after the compareN/length rules otherwise
610610
-- it may inline before the rules have an opportunity to fire.
611611

0 commit comments

Comments
 (0)