Bryan O'Sullivan avatar Bryan O'Sullivan committed 6b47c79

Note more functions subject to fusion.

Comments (0)

Files changed (1)

 -- ** Generating and unfolding 'Text's
 
 -- | /O(n)/ 'replicate' @n@ @c@ is a 'Text' of length @n@ with @c@ the
--- value of every element.
+-- value of every element. Subject to fusion.
 replicate :: Int -> Char -> Text
 replicate n c = unstream (S.replicate n c)
 {-# INLINE replicate #-}
 -- 'Text' from a seed value. The function takes the element and
 -- returns 'Nothing' if it is done producing the 'Text', otherwise
 -- 'Just' @(a,b)@.  In this case, @a@ is the next 'Char' in the
--- string, and @b@ is the seed value for further production.
+-- string, and @b@ is the seed value for further production. Subject
+-- to fusion.
 unfoldr     :: (a -> Maybe (Char,a)) -> a -> Text
 unfoldr f s = unstream (S.unfoldr f s)
 {-# INLINE unfoldr #-}
 -- value. However, the length of the result should be limited by the
 -- first argument to 'unfoldrN'. This function is more efficient than
 -- 'unfoldr' when the maximum length of the result is known and
--- correct, otherwise its performance is similar to 'unfoldr'.
+-- correct, otherwise its performance is similar to 'unfoldr'. Subject
+-- to fusion.
 unfoldrN     :: Int -> (a -> Maybe (Char,a)) -> a -> Text
 unfoldrN n f s = unstream (S.unfoldrN n f s)
 {-# INLINE unfoldrN #-}
 
 -- | /O(n)/ 'take' @n@, applied to a 'Text', returns the prefix of the
 -- 'Text' of length @n@, or the 'Text' itself if @n@ is greater than
--- the length of the Text.
+-- the length of the Text. Subject to fusion.
 take :: Int -> Text -> Text
 take n t@(Text arr off len)
     | n <= 0    = empty
 
 -- | /O(n)/ 'drop' @n@, applied to a 'Text', returns the suffix of the
 -- 'Text' of length @n@, or the empty 'Text' if @n@ is greater than the
--- length of the 'Text'.
+-- length of the 'Text'. Subject to fusion.
 drop :: Int -> Text -> Text
 drop n t@(Text arr off len)
     | n <= 0    = t
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.