Skip to content

Commit 3db5817

Browse files
committed
find and index are actually subject to fusion.
1 parent 67ab7b2 commit 3db5817

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data/Text.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ chunksOf k = go
14661466

14671467
-- | /O(n)/ The 'find' function takes a predicate and a 'Text', and
14681468
-- returns the first element matching the predicate, or 'Nothing' if
1469-
-- there is no such element.
1469+
-- there is no such element. Subject to fusion.
14701470
find :: (Char -> Bool) -> Text -> Maybe Char
14711471
find p t = S.findBy p (stream t)
14721472
{-# INLINE find #-}
@@ -1582,7 +1582,7 @@ breakOnAll pat src@(Text arr off slen)
15821582
-- searching for the index of @\"::\"@ and taking the substrings
15831583
-- before and after that index, you would instead use @breakOnAll \"::\"@.
15841584

1585-
-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
1585+
-- | /O(n)/ 'Text' index (subscript) operator, starting from 0. Subject to fusion.
15861586
index :: Text -> Int -> Char
15871587
index t n = S.index (stream t) n
15881588
{-# INLINE index #-}

0 commit comments

Comments
 (0)