h*ni      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.1.0.0 Safe-Inferred j parser-regex A set of Chars./The members are stored as contiguous ranges of Chars. This is efficient when the members form contiguous ranges since many Char*s can be represented with just one range. parser-regexThe empty set. parser-regexO(1). A set of one Char. parser-regexO(1). A Char range (inclusive). parser-regexO(s \min(s,C)). Create a set from Char s in a list. parser-regexO(n \min(n,C)). Create a set from the given Char ranges (inclusive). parser-regex O(\min(n,C)) . Insert a Char into a set. parser-regex O(\min(n,C)) . Insert all Char$s in a range (inclusive) into a set. parser-regex O(\min(n,C)) . Delete a Char from a set.  parser-regex O(\min(n,C)) . Delete a Char range (inclusive) from a set.  parser-regexO(s \min(s,C)). Map a function over all Char s in a set.  parser-regexO(n). The complement of a set.  parser-regexO(m \min(n+m,C)). The union of two sets.Prefer strict left-associative unions, since this is a strict structure and the runtime is linear in the size of the second argument.  parser-regexO(m \min(n+m,C)). The difference of two sets. parser-regexO(n + m \min(n+m,C)). The intersection of two sets. parser-regex O(\min(n,C)) . Whether a Char is in a set. parser-regex O(\min(n,C)) . Whether a Char is not in a set. parser-regexO(s). The Char s in a set. parser-regexO(n). The contiguous ranges of Chars in a set. parser-regex O(\min(n,W))". Split a set into one containing Chars smaller than the given Char, and one greater than or equal to the given Char. parser-regexO(\min(n+m,W)). Join two sets. Every Char- in the left set must be smaller than every Char in the right set. !This precondition is not checked. parser-regexO(n) . Fold over the ranges in a set. parser-regexO(n);. The complement of non-overlapping sorted ranges of Chars. parser-regex+Is the internal structure of the set valid? parser-regex  mempty =  parser-regex (<>) =   parser-regex  fromString =   Safe-Inferred parser-regexASCII digits. '0'..'9'. Agrees with  . parser-regex(ASCII alphabet, digits and underscore. 'A'..'Z','a'..'z','0'..'9','_'. parser-regex5Unicode space characters and the control characters '\t','\n','\r','\f','\v'. Agrees with  . parser-regexASCII Chars.  '\0'..'\127'. Agrees with  . parser-regexASCII alphabet. 'A'..'Z','a'..'z'. parser-regexASCII uppercase Chars. 'A'..'Z'. Agrees with  . parser-regexASCII lowercase Chars. 'a'..'z'. Agrees with  . Safe-Inferred<   Safe-Inferred Safe-Inferred)*  parser-regex%A single value repeating indefinitely parser-regex A finite list parser-regexA regular expression. Operates on a sequence of elements of type c! and capable of parsing into an a.A RE, is a Functor, Applicative, and Alternative.": Succeed without consuming input., , , : Sequential composition.: Fail.: Alternative composition. Left-biased, i.e. the result of parsing using a <|> b is the result of parsing using a if it succeeds, otherwise it is the result of parsing using b, if it succeeds, otherwise parsing fails.: Zero or more. many a parses multiple a5s sequentially. Biased towards matching more. Use , for a bias towards matching less. Also see the section "Looping parsers".: One or more. some a parses multiple a5s sequentially. Biased towards matching more. Use +" for a bias towards matching less.In addition to expected Functor, Applicative, and Alternative laws, RE* obeys these Applicative-Alternative laws: a <*> empty = empty empty <*> a = empty (a <|> b) <*> c = (a <*> c) <|> (b <*> c) a <*> (b <|> c) = (a <*> b) <|> (a <*> c) "Note that, because of bias, it is not true that a <|> b = b <|> a.Performance note9: Prefer the smaller of equivalent regexes, i.e. prefer (a <|> b) <*> c over (a <*> c) <|> (b <*> c).! parser-regexParse a c into an a if the given function returns Just." parser-regex+Zero or more. Biased towards matching more.'Also see the section "Looping parsers".# parser-regex#Parse many occurences of the given RE. Biased towards matching more.'Also see the section "Looping parsers".% parser-regex#Parse many occurences of the given RE.. Minimal, i.e. biased towards matching less.' parser-regexParse a c% if it satisfies the given predicate.( parser-regexParse the given c.) parser-regex Parse any c.* parser-regex/Zero or one. Minimal, i.e. biased towards zero.Use Control.Applicative.% for the same but biased towards one.+ parser-regex8One or more. Minimal, i.e. biased towards matching less., parser-regex9Zero or more. Minimal, i.e. biased towards matching less.- parser-regex/At least n times. Biased towards matching more.. parser-regex.At most n times. Biased towards matching more./ parser-regexBetween m and n times (inclusive). Biased towards matching more.0 parser-regex=At least n times. Minimal, i.e. biased towards matching less.1 parser-regex) = liftA2 (<>)1!)('#%"*+,-./0123456789:;< $& Safe-Inferred# parser-regexLength in base 16. parser-regex416^i. i must not be large enough to overflow a Word. parser-regexLength in base 10. parser-regex"999..." repeated safeWordDecLen times is guaranteed to fit in a Word. parser-regex$Decimal length of (maxBound :: Word) parser-regex(Hexadecimal length of (maxBound :: Word) parser-regex410^i. i must not be large enough to overflow a Word. parser-regexacc parser-regexlength of acc in some base parser-regexaccs, little endian parser-regex Leading digit parser-regexEverything else parser-regex Leading digit parser-regexEverything else Safe-Inferred$ parser-regex A set of s. The bitmask is a set for IDs 0..63 (0..31 if 32-bit). Set operations on this are very fast and speed up the common case of small regexes a little bit, at the cost of a little more memory. parser-regexA unique ID. Must be >= 0. Safe-Inferred)*+X = parser-regexA fold function.> parser-regex!The state maintained for parsing. parser-regex(A node in the NFA. Used for recognition.? parser-regexA parser compiled from a  c a.@ parser-regexO(m) . Compile a RE c a to a  Parser c a.Note: compile does not limit the size of the RE. See A( if you would like to limit the size. REs with size greater than (maxBound::Int) `div` 2/ are not supported and the behavior of such a RE is undefined.A parser-regex O(\min(l,m)) . Compile a RE c a to a  Parser c a.Returns Nothing if the size of the RE% is greater than the provided limit l3. You may want to use this if you suspect that the RE may be too large, for instance if the regex is constructed from an untrusted source.While the exact size of a RE depends on an internal representation, it can be assumed to be in the same order as the length of a  7https://en.wikipedia.org/wiki/Regular_expression#Syntax regex pattern corresponding to the RE.B parser-regex O(m \log m). Prepare a parser for input.C parser-regex O(m \log m),. Step a parser by feeding a single element c . Returns Nothing if the parse has failed regardless of further input. Otherwise, returns an updated  ParserState.D parser-regexO(1). Get the parse result for the input fed into the parser so far.E parser-regex O(mn \log m) . Run a parser given a sequence f and a fold of f.?@A>BCD=E Safe-InferredI'F parser-regexA type alias for convenience.A function which accepts a  Parser c a will accept a  ParserText a.G parser-regexA type alias for convenience.A function which accepts a RE c a will accept a REText a.H parser-regex The token type used for parsing Text.I parser-regexParse a Char into an a if the given function returns Just.J parser-regexParse a Char% if it satisfies the given predicate.K parser-regexParse the given Char.L parser-regexParse the given Char, ignoring case.*Comparisons are performed after applying  9https://www.unicode.org/reports/tr44/#Simple_Case_Foldingsimple case folding' as described by the Unicode standard.M parser-regex Parse any Char.N parser-regexParse a Char if it is a member of the CharSet.O parser-regexParse the given Text.P parser-regexParse the given Text, ignoring case.*Comparisons are performed after applying  9https://www.unicode.org/reports/tr44/#Simple_Case_Foldingsimple case folding' as described by the Unicode standard.Q parser-regex Parse any Text. Biased towards matching more.R parser-regexParse any non-empty Text. Biased towards matching more.S parser-regex Parse any Text-. Minimal, i.e. biased towards matching less.T parser-regexParse any non-empty Text-. Minimal, i.e. biased towards matching less.U parser-regex Parse any Text containing members of the CharSet . Biased towards matching more.V parser-regexParse any non-empty Text containing members of the CharSet . Biased towards matching more.W parser-regex Parse any Text containing members of the CharSet.. Minimal, i.e. biased towards matching less.X parser-regexParse any non-empty Text containing members of the CharSet.. Minimal, i.e. biased towards matching less.Y parser-regexParse a decimal Natural. Leading zeros are not accepted. Biased towards matching more.Z parser-regexParse a decimal Integer. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Leading zeros are not accepted. Biased towards matching more.[ parser-regexParse a hexadecimal Natural. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.\ parser-regexParse a hexadecimal Integer. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.] parser-regexParse a decimal Word in the range  [low..high]. Leading zeros are not accepted. Biased towards matching more.^ parser-regexParse a decimal Int in the range  [low..high]. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Leading zeros are not accepted. Biased towards matching more._ parser-regexParse a hexadecimal Word in the range  [low..high]. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.` parser-regexParse a hexadecimal Int in the range  [low..high]. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.a parser-regexParse a Word of exactly n decimal digits, including any leading zeros. Will not parse values that do not fit in a Word . Biased towards matching more.b parser-regexParse a Word of exactly n hexadecimal digits, including any leading zeros. Both uppercase 'A'..'F' and lowercase 'a'..'f'; are accepted. Will not parse values that do not fit in a Word . Biased towards matching more.c parser-regex Rebuild the RE% such that the result is the matched Text instead.d parser-regex Rebuild the RE to include the matched Text alongside the result.e parser-regex O(mn \log m) . Parse a Text with a REText.Uses , see the note there.If parsing multiple Texts using the same RE!, it is wasteful to compile the RE every time. So, prefer toCompile once with  or  and use the compiled F with f as many times as required.0Alternately, partially apply this function to a RE3 and use the function as many times as required.f parser-regex O(mn \log m) . Parse a Text with a  ParserText.g parser-regex O(mn \log m) . Parse a Text with a  ParserText. Calls  on parse failure.2For use with parsers that are known to never fail.h parser-regex O(mn \log m)(. Find the first occurence of the given RE in a Text.Examplesfind (text "meow") "homeowner" Just "meow"To test whether a Text is present in another Text, like above, prefer  Data.Text..6find (textIgnoreCase "haskell") "Look I'm Haskelling!"Just "Haskell")find (text "backtracking") "parser-regex"Nothingi parser-regex O(mn \log m)3. Find all non-overlapping occurences of the given RE in the Text.Examples!findAll (text "ana") "banananana" ["ana","ana"] data Roll = Roll Natural -- ^ Rolls Natural -- ^ Faces on the die deriving Show roll :: REText Roll roll = Roll <$> (Y <|> pure 1) <* K 'd' <*> naturalDec findAll roll "3d6, d10, 2d10"[Roll 3 6,Roll 1 10,Roll 2 10]j parser-regex O(mn \log m) . Split a Text at occurences of the given RE.Examples1splitOn (char ' ') "Glasses are really versatile"&["Glasses","are","really","versatile"])For simple splitting, like above, prefer  Data.Text.,  Data.Text.,  Data.Text. or  Data.Text., whichever is applicable.splitOn (char ' ' *> oneOf "+-=" *> char ' ') "3 - 1 + 1/2 - 2 = 0"["3","1","1/2","2","0"]If the Text starts or ends with a delimiter, the result will contain empty Texts at those positions.splitOn (char 'a') "ayaya"["","y","y",""]k parser-regex O(mn \log m)'. Replace the first match of the given RE7 with its result. If there is no match, the result is Nothing.Examples5replace ("world" <$ text "Haskell") "Hello, Haskell!"Just "Hello, world!"2replace ("," <$ some (char '.')) "one...two...ten"Just "one,two...ten"l parser-regex O(mn \log m)/. Replace non-overlapping matches of the given RE with their results.Examples4replaceAll (" and " <$ text ", ") "red, blue, green""red and blue and green"+For simple replacements like above, prefer  Data.Text..replaceAll ("Fruit" <$ text "Time" <|> "banana" <$ text "arrow") "Time flies like an arrow""Fruit flies like a banana" sep = N "-./" digits n = c ( replicateM_ n (oneOf )) toYmd d m y = mconcat [y, "-", m, "-", d] date = toYmd <$> digits 2 <* sep <*> digits 2 <* sep <*> digits 4 4replaceAll date "01/01/1970, 01-04-1990, 03.07.2011"$"1970-01-01, 1990-04-01, 2011-07-03"'HGIJKLMNOPQRSTUVWXYZ[\]^_`abcdeFfghijkl Safe-InferredeS m parser-regexParse the given list.n parser-regex-Parse any list. Biased towards matching more.o parser-regex7Parse any non-empty list. Biased towards matching more.p parser-regex;Parse any list. Minimal, i.e. biased towards matching less.q parser-regexParse any non-empty String-. Minimal, i.e. biased towards matching less.r parser-regexParse the given Char, ignoring case.*Comparisons are performed after applying  9https://www.unicode.org/reports/tr44/#Simple_Case_Foldingsimple case folding' as described by the Unicode standard.s parser-regexParse a Char if it is a member of the CharSet.t parser-regexParse the given String, ignoring case.*Comparisons are performed after applying  9https://www.unicode.org/reports/tr44/#Simple_Case_Foldingsimple case folding' as described by the Unicode standard.u parser-regex Parse any String containing members of the CharSet . Biased towards matching more.v parser-regexParse any non-empty String containing members of the CharSet . Biased towards matching more.w parser-regex Parse any String containing members of the CharSet.. Minimal, i.e. biased towards matching less.x parser-regexParse any non-empty String containing members of the CharSet.. Minimal, i.e. biased towards matching less.y parser-regexParse a decimal Natural. Leading zeros are not accepted. Biased towards matching more.z parser-regexParse a decimal Integer. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Leading zeros are not accepted. Biased towards matching more.{ parser-regexParse a hexadecimal Natural. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.| parser-regexParse a hexadecimal Integer. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more.} parser-regexParse a decimal Word in the range  [low..high]. Leading zeros are not accepted. Biased towards matching more.~ parser-regexParse a decimal Int in the range  [low..high]. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Leading zeros are not accepted. Biased towards matching more. parser-regexParse a hexadecimal Word in the range  [low..high]. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more. parser-regexParse a hexadecimal Int in the range  [low..high]. Parse an optional sign, '-' or '+', followed by the given RE, followed by the absolute value of the integer. Both uppercase 'A'..'F' and lowercase 'a'..'f' are accepted. Leading zeros are not accepted. Biased towards matching more. parser-regexParse a Word of exactly n decimal digits, including any leading zeros. Will not parse values that do not fit in a Word . Biased towards matching more. parser-regexParse a Word of exactly n hexadecimal digits, including any leading zeros. Both uppercase 'A'..'F' and lowercase 'a'..'f'; are accepted. Will not parse values that do not fit in a Word . Biased towards matching more. parser-regex Rebuild the RE such that the result is the matched section of the list instead. parser-regex Rebuild the RE to include the matched section of the list alongside the result. parser-regex O(mn \log m). Parse a list with a RE.Uses , see the note there.)If parsing multiple lists using the same RE!, it is wasteful to compile the RE every time. So, prefer toCompile once with  or  and use the compiled ? with  as many times as required.0Alternately, partially apply this function to a RE3 and use the function as many times as required. parser-regex O(mn \log m). Parse a list with a Parser. parser-regex O(mn \log m). Parse a list with a Parser. Calls  on parse failure.2For use with parsers that are known to never fail. parser-regex O(mn \log m)(. Find the first occurence of the given RE in a list.Examplesfind (list "meow") "homeowner" Just "meow"To test whether a list is present in another list, like above, prefer  Data.List..8find (stringIgnoreCase "haskell") "Look I'm Haskelling!"Just "Haskell")find (list "backtracking") "parser-regex"Nothing parser-regex O(mn \log m)3. Find all non-overlapping occurences of the given RE in the list.Examples!findAll (list "ana") "banananana" ["ana","ana"] data Roll = Roll Natural -- ^ Rolls Natural -- ^ Faces on the die deriving Show roll :: RE Char Roll roll = Roll <$> (y <|> pure 1) <* ( 'd' <*> naturalDec findAll roll "3d6, d10, 2d10"[Roll 3 6,Roll 1 10,Roll 2 10] parser-regex O(mn \log m)*. Split a list at occurences of the given RE.Examples3splitOn (single ' ') "Glasses are really versatile"&["Glasses","are","really","versatile"]"In cases like above, prefer using  or  instead, if applicable.splitOn (single ' ' *> oneOfChar "+-=" *> single ' ') "3 - 1 + 1/2 - 2 = 0"["3","1","1/2","2","0"]If the list starts or ends with a delimiter, the result will contain empty lists at those positions.splitOn (single 'a') "ayaya"["","y","y",""] parser-regex O(mn \log m)'. Replace the first match of the given RE7 with its result. If there is no match, the result is Nothing.Examples5replace ("world" <$ list "Haskell") "Hello, Haskell!"Just "Hello, world!"4replace ("," <$ some (single '.')) "one...two...ten"Just "one,two...ten" parser-regex O(mn \log m)/. Replace non-overlapping matches of the given RE with their results.Examples4replaceAll (" and " <$ list ", ") "red, blue, green""red and blue and green"replaceAll ("Fruit" <$ list "Time" <|> "banana" <$ list "arrow") "Time flies like an arrow""Fruit flies like a banana" sep = s "-./" digits n =  replicateM n (oneOfChar ) toYmd d m y = concat [y, "-", m, "-", d] date = toYmd <$> digits 2 <* sep <*> digits 2 <* sep <*> digits 4 4replaceAll date "01/01/1970, 01-04-1990, 03.07.2011"$"1970-01-01, 1990-04-01, 2011-07-03" mnopqrstuvwxyz{|}~ Safe-Inferrede+?@A>BCD=E!)('#%"*+,-./0123456789:;< $&+?@A>BCD=E!)('#%"*+,-./0123456789:;< $&  Safe-Inferred"hF parser-regex Generate a  'https://graphviz.org/doc/info/lang.html Graphviz DOT visualization of a . Optionally takes an alphabet [c]$, which will be tested against the token functions in the $ and accepted characters displayed. parser-regex Generate a  'https://graphviz.org/doc/info/lang.html Graphviz DOT visualization of a ?. Optionally takes an alphabet [c]$, which will be tested against the token functions in the ?( and the accepted characters displayed.6 Safe-Inferredhz?!'()mnopqrstuvwxyz{|}~#%"*+,-./0123456789:?@A?!'()mnopqrstuvwxyz{|}~#%"*+,-./0123456789:?@A Safe-Inferredi8HGIJKLMNOPQRSTUVWXYZ[\]^_`ab#%cd"*+,-./0123456789:e?F@AfghijklHGIJKLMNOPQRSTUVWXYZ[\]^_`ab#%cd"*+,-./0123456789:e?F@Afghijkl!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefAGghijklmnopqrstuvwxyz{|}~huvwxyz{|}~""0'    +parser-regex-0.1.0.0-EADtbGRXX9ECjwyAas4I5j Data.CharSet Regex.Base Regex.Text Regex.List parser-regexRegex.Internal.CharSetRegex.Internal.CharSets Data.CharisDigitisSpaceisAscii isAsciiUpper isAsciiLower!Regex.Internal.Generated.CaseFoldRegex.Internal.RegexRegex.Internal.NumRegex.Internal.UniqueRegex.Internal.ParserRegex.Internal.TextcompilecompileBounded Data.TextwordslinessplitsplitOnreplacedigitRegex.Internal.List Data.List isInfixOfRegex.Internal.DebugCharSetempty singleton fromRangefromList fromRangesinsert insertRangedelete deleteRangemapnotunion difference intersectionmember notMemberelemsrangesvalidwordspaceascii asciiAlpha asciiUpper asciiLowerManyRepeatFiniteREfmap'liftA2'tokenmanyr foldlMany foldlMany' foldlManyMin foldlManyMin'satisfysingle anySingle optionalMinsomeMinmanyMinatLeastatMost betweenCount atLeastMin atMostMinbetweenCountMinsepBysepBy1endByendBy1sepEndBy sepEndBy1chainl1chainr1toFind toFindManyFoldr ParserStateParser prepareParser stepParser finishParser parseFoldr ParserTextREText TextTokencharcharIgnoreCaseanyCharoneOftexttextIgnoreCasemanyTextsomeText manyTextMin someTextMin manyTextOf someTextOf manyTextOfMin someTextOfMin naturalDec integerDec naturalHex integerHex wordRangeDec intRangeDec wordRangeHex intRangeHexwordDecNwordHexNtoMatch withMatchreParseparse parseSurefindfindAll replaceAlllistmanyListsomeList manyListMin someListMin oneOfCharstringIgnoreCase manyStringOf someStringOfmanyStringOfMinsomeStringOfMinjoin foldlRanges'complementRanges$fMonoidCharSet$fSemigroupCharSet$fIsStringCharSetcaseFoldSimplebaseGHC.BasepureliftA2<*>*><*<|>manysomeControl.Applicativeoptional $fMonoidRE $fSemigroupRERTokenRFmapRFmap_RPureRLiftA2REmptyRAltRFoldRMany StrictnessStrict NonStrict GreedinessGreedyMinimallen16pow16len10safeWordDecLenmaxBoundWordDecLenmaxBoundWordHexLenpow10 NatParseState finishHex finishDec mkNaturalDec mkWordDecNmkWordRangeDec mkNaturalHex mkWordHexNmkWordRangeHexmkSignedIntegermkSignedIntRange UniqueSetUniqueunUniqueNodePTokenPFmapPFmap_PPurePLiftA2PEmptyPAltPFoldGrPFoldMnPManyNAcceptNGuardNTokenNEmptyNAltGHC.Errerror text-2.0.2 Data.OldListreToDot parserToDotdispCharRanges<+>