@@ -130,7 +130,7 @@ module Data.Text
130 -- * Indexing
130 -- * Indexing
132 , findIndex
132 , findIndex
133− -- , findIndices
133+ , findIndices
134 , elemIndex
134 , elemIndex
135 -- , elemIndices
135 -- , elemIndices
136 -- , count
136 -- , count
@@ -823,16 +823,24 @@ index :: Text -> Int -> Char
823index t n = S.index (stream t) n
823index t n = S.index (stream t) n
824{-# INLINE index #-}
824{-# INLINE index #-}
826−-- | The 'findIndex' function takes a predicate and a 'Text' and
826+-- | /O(n)/ The 'findIndex' function takes a predicate and a 'Text'
827−-- returns the index of the first element in the 'Text'
827+-- and returns the index of the first element in the 'Text' satisfying
828−-- satisfying the predicate.
828+-- the predicate. This function is subject to fusion.
829findIndex :: (Char -> Bool) -> Text -> Maybe Int
829findIndex :: (Char -> Bool) -> Text -> Maybe Int
830findIndex p t = S.findIndex p (stream t)
830findIndex p t = S.findIndex p (stream t)
831{-# INLINE findIndex #-}
831{-# INLINE findIndex #-}
833+-- | The 'findIndices' function extends 'findIndex', by returning the
834+-- indices of all elements satisfying the predicate, in ascending
835+-- order. This function is subject to fusion.
836+findIndices :: (Char -> Bool) -> Text -> [Int]
837+findIndices p t = S.findIndices p (stream t)
838+{-# INLINE findIndices #-}
833-- | /O(n)/ The 'elemIndex' function returns the index of the first
840-- | /O(n)/ The 'elemIndex' function returns the index of the first
834-- element in the given 'Text' which is equal to the query element, or
841-- element in the given 'Text' which is equal to the query element, or
835−-- 'Nothing' if there is no such element.
842+-- 'Nothing' if there is no such element. This function is subject to
836elemIndex :: Char -> Text -> Maybe Int
844elemIndex :: Char -> Text -> Maybe Int
837elemIndex c t = S.elemIndex c (stream t)
845elemIndex c t = S.elemIndex c (stream t)