module Data.ByteString.Lazy.Search(
indices
, nonOverlappingIndices
, breakOn
, breakAfter
, breakFindAfter
, replace
, split
, splitKeepEnd
, splitKeepFront
, strictify
) where
import qualified Data.ByteString.Lazy.Search.Internal.BoyerMoore as BM
import Data.ByteString.Search.Substitution
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
import Data.Int (Int64)
{-# INLINE indices #-}
indices :: S.ByteString
-> L.ByteString
-> [Int64]
indices = BM.matchSL
{-# INLINE nonOverlappingIndices #-}
nonOverlappingIndices :: S.ByteString
-> L.ByteString
-> [Int64]
nonOverlappingIndices = BM.matchNOL
{-# INLINE breakOn #-}
breakOn :: S.ByteString
-> L.ByteString
-> (L.ByteString, L.ByteString)
breakOn = BM.breakSubstringL
{-# INLINE breakAfter #-}
breakAfter :: S.ByteString
-> L.ByteString
-> (L.ByteString, L.ByteString)
breakAfter = BM.breakAfterL
{-# INLINE breakFindAfter #-}
breakFindAfter :: S.ByteString
-> L.ByteString
-> ((L.ByteString, L.ByteString), Bool)
breakFindAfter = BM.breakFindAfterL
{-# INLINE replace #-}
replace :: Substitution rep
=> S.ByteString
-> rep
-> L.ByteString
-> L.ByteString
replace = BM.replaceAllL
{-# INLINE split #-}
split :: S.ByteString
-> L.ByteString
-> [L.ByteString]
split = BM.splitDropL
{-# INLINE splitKeepEnd #-}
splitKeepEnd :: S.ByteString
-> L.ByteString
-> [L.ByteString]
splitKeepEnd = BM.splitKeepEndL
{-# INLINE splitKeepFront #-}
splitKeepFront :: S.ByteString
-> L.ByteString
-> [L.ByteString]
splitKeepFront = BM.splitKeepFrontL
strictify :: L.ByteString -> S.ByteString
strictify = S.concat . L.toChunks