@@ -118,7 +118,6 @@ module Data.Text
118 , splitTimes
118 , splitTimes
119 , splitChar
119 , splitChar
120 , splitWith
120 , splitWith
123 -- ** Breaking into lines and words
122 -- ** Breaking into lines and words
@@ -941,38 +940,6 @@ partition :: (Char -> Bool) -> Text -> (Text, Text)
941partition p t = (filter p t, filter (not . p) t)
940partition p t = (filter p t, filter (not . p) t)
942{-# INLINE partition #-}
941{-# INLINE partition #-}
944−-- | /O(n)/ Break a string on a substring, returning a pair of the
945−-- part of the string prior to the match, and the rest of the string.
947−-- The following relationship holds:
949−-- > break (==c) l == breakSubstring (singleton c) l
951−-- For example, to tokenise a string, dropping delimiters:
953−-- > tokenise x y = h : if null t then [] else tokenise x (drop (length x) t)
954−-- > where (h,t) = breakSubstring x y
956−-- To skip to the first occurence of a string:
958−-- > snd (breakSubstring x y)
960−-- To take the parts of a string before a delimiter:
962−-- > fst (breakSubstring x y)
964−breakSubstring :: Text -- ^ String to search for
965− -> Text -- ^ String to search in
966− -> (Text,Text) -- ^ Head and tail of string broken at substring
968−breakSubstring pat src = search 0 src
971− | null s = (src,empty) -- not found
972− | pat `isPrefixOf` s = (take n src,s)
973− | otherwise = search (n+1) (unsafeTail s)
974−{-# INLINE breakSubstring #-}
976-- | /O(n)/ 'filter', applied to a predicate and a 'Text',
943-- | /O(n)/ 'filter', applied to a predicate and a 'Text',
977-- returns a 'Text' containing those characters that satisfy the
944-- returns a 'Text' containing those characters that satisfy the
978-- predicate.
945-- predicate.