module StrBldr.Text.Lazy ( Str , Bldr , fromBuilder , toBuilder , splitAt , null , allMatches ) where import qualified Data.Text.Lazy as L (Text) import qualified Data.Text.Lazy as L.Txt import Data.Text.Lazy.Builder (Builder) import qualified Data.Text.Lazy.Builder as Txt.Bldr import Text.Regex.PCRE.Heavy (Regex) import qualified Text.Regex.PCRE.Heavy as Pcre.H import Prelude hiding (splitAt, null) type Str = L.Text type Bldr = Builder toBuilder :: Str -> Bldr toBuilder = Txt.Bldr.fromLazyText fromBuilder :: Bldr -> Str fromBuilder = Txt.Bldr.toLazyText null :: Str -> Bool null = L.Txt.null splitAt :: Int -> Str -> (Str, Str) splitAt n str = L.Txt.splitAt (fromIntegral n) str allMatches :: Regex -> Str -> [((Int, Int), [(Int, Int)])] allMatches = Pcre.H.scanRanges