module Deriv.StrMat.ByteString.Strict ( Str , Mat , group , groups , match , matchAndGroups , regexing , toUpper , loadFile ) where import qualified Data.ByteString as S (ByteString) import qualified Data.ByteString as S.Byt import qualified Data.ByteString.Char8 as S.Byt.Char8 import qualified Data.Char as Char import Optics.Core (IxTraversal', Getter) import Optics.Regex.ByteString.Strict (Match) import qualified Optics.Regex.ByteString.Strict as Opt.S.Byt import Text.Regex.PCRE.Heavy (Regex) type Str = S.ByteString type Mat = Match group :: Int -> IxTraversal' Str Mat Str group = Opt.S.Byt.group groups :: IxTraversal' Str Mat [Str] groups = Opt.S.Byt.groups match :: IxTraversal' [Str] Mat Str match = Opt.S.Byt.match matchAndGroups :: Getter Mat (Str, [Str]) matchAndGroups = Opt.S.Byt.matchAndGroups regexing :: Regex -> IxTraversal' Int Str Mat regexing = Opt.S.Byt.regexing toUpper :: Str -> Str toUpper = S.Byt.Char8.map Char.toUpper loadFile :: String -> IO Str loadFile = S.Byt.readFile