on master help sign in
Uncomment isInfixOf for lazy text.
commit503c3960edfb13e0cfc4ed62534a9a5e2f186290 authorLuigy Leon <luigy@outlook.com> dateThu 6 Oct 2016, 10:15 (10 years ago) parent2de66fd
1 file changed+4−5
Data/Text/Lazy.hs+4−5
Data/Text/Lazy.hs+4−5
@@ -1574,11 +1574,10 @@ isSuffixOf x y = reverse x `isPrefixOf` reverse y
15741574-- In (unlikely) bad cases, this function's time complexity degrades
15751575-- towards /O(n*m)/.
15761576isInfixOf :: Text -> Text -> Bool
1577−isInfixOf _ _ = True
1578−-- isInfixOf needle haystack
1579−-- | null needle = True
1580−-- | isSingleton needle = S.elem (head needle) . S.stream $ haystack
1581−-- | otherwise = not . L.null . indices needle $ haystack
1577+isInfixOf needle haystack
1578+ | null needle = True
1579+ | isSingleton needle = S.elem (head needle) . S.stream $ haystack
1580+ | otherwise = not . L.null . indices needle $ haystack
15821581{-# INLINE [1] isInfixOf #-}
15831582
15841583{-# RULES