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