úÎu½gؼ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»Safe&,Flipped . Great for parsing infixes, e.g.  addExpr = expr <$$> (+) <*> expr.p <||> q tries to parse p, but if it fails, parses q. Unlike the ¼ instance for ½, backtracking will occur if p& fails. That is, a parser such as !string "flange" <||> string "fly" will succeed on the input "fly"9, whereas its Parsec counterpart will unintuitively fail. choice ps( tries to apply the parsers in the list ps± in order, until one of them succeeds. Returns the value of the succeeding parser. Unlike the Parsec version, this one ensures that parsers do not consume input if they fail. ˜Given a map of parsers to parsers, attempt each key parser until one succeeds, then perform the value parser. Return the result of the value parser.!èAttempt all of the passed parsers under the current conditions and return the value of the parser which makes it furthest into the input stream (and updates the parser's internals as if that were the only parser parsed). 'longestOf [string "do", string "don't"]" option x p tries to apply parser p. If p! fails, no input is consumed and x is returned.# optional p tries to parse p(, but does not fail or consume input of p fails. This is like , but is easier to type. See $.$ optional_ p tries to parse p(, but does not fail or consume input if p fails.ŽThis is like Parsec's Text.Parsec.Combinator.optional', but the use of underscore is more idiomatic for actions whose results are ignored.% atLeast n p applies the parser p n or more times.& atMost n p applies the parser p up to n times.' manyNM n m p applies the parser p n or more times up to m times.(Parse zero* or more of any mix of the passed parsers.)As (, but ignoring the results.*many p applies the parser p zero* or more times and accumulates the result.+many p applies the parser p one* or more times and accumulates the result.,many1_ p applies the parser p one% or more times, skipping its result.-many1_ p applies the parser p zero% or more times, skipping its result..manyTill p end applies parser p zero or more times until parser end2 succeeds. Returns the list of values returned by p . The end parser does not consume input, c.f. //. This parser can be used to scan comments: j simpleComment = do { string "//" ; anyChar `manyTill` char '\n' }*Note that despite the overlapping parsers anyChar and  char '\n'%, there is never a need to add a try: the end. parser does not consume input on failure./manyThru p end applies parser p zero or more times until parser end2 succeeds. Returns the list of values returned by p . The end parser does consume input, c.f. .V, but is not included in the result. This parser can be used to scan comments: o simpleComment = do { string "<!--" ; anyChar `manyThru` string "-->" }*Note that despite the overlapping parsers anyChar and  string "-->" , there is no need to add a try: the end. parser does not consume input on failure.0 chomp p x will parse p, then, provided x- succeeds, discard a subsequent parse of x*. This combinator will only fail when p fails, not when x does.1 between2 p q is equivalent to between p p q #double_quoted = between2 (char '"')2 sepBy p sep parses zero or more occurrences of p, separated by sep'. Returns a list of values returned by p. % commaSep p = p `sepBy` (symbol ",")3 sepBy1 p sep parses one or more occurrences of p, separated by sep'. Returns a list of values returned by p. 4sepEndBy p sep parses zero or more occurrences of p%, separated and optionally ended by sep. 6 haskellStatements = haskellStatement `sepEndBy` semi5sepEndBy1 p sep parses one or more occurrences of p(, separated and optionally ended by sep.6 endBy p sep parses zero or more occurrences of p, seperated and ended by sep. ( cStatements = cStatement `endBy` semi7 endBy1 p sep parses one or more occurrences of p, seperated and ended by sep.8sepAroundBy p sep parses zero or more occurrences of p:, separated and optionally starting with and ended by sep.9sepAroundBy1 p sep parses one or more occurrences of p:, separated and optionally starting with and ended by sep.: chainl p op z parses zero or more occurrences of p, separated by op . Returns a value obtained by a left: associative application of all functions returned by op to the values returned by p#. If there are zero occurrences of p , the value z is returned. C.f. <.; chainl1 p op parses one or more occurrences of p, separated by op Returns a value obtained by a left: associative application of all functions returned by op to the values returned by pt. This parser can for example be used to eliminate left recursion which typically occurs in expression grammars. ÿ expr = term `chainl1` mulop term = factor `chainl1` addop factor = parens expr <|> integer mulop = do{ symbol "*"; return (*) } <|> do{ symbol "/"; return (div) } addop = do{ symbol "+"; return (+) } <|> do{ symbol "-"; return (-) }C.f. =.< chainr p op z parses zero or more occurrences of p, separated by op Returns a value obtained by a right: associative application of all functions returned by op to the values returned by p!. If there are no occurrences of p , the value z is returned. C.f. :.= chainr1 p op parses one or more occurrences of p, separated by op Returns a value obtained by a right: associative application of all functions returned by op to the values returned by p. C.f. ;.> lookAhead p parses p& without consuming any input, even if p fails. ?As >, but throw away result.@notFollowedBy p q parses p, but only when q) will fail immediately after parsing p . Parsing qN never consumes input, and if this combinator fails, no input is consumed.{This combinator can be used to implement the 'longest match' rule. For example, when recognizing keywords (for example let¥), we want to make sure that a keyword is not followed by a legal identifier character, in which case the keyword is actually an identifier (for example lets+). We can program this behavior as follows: 3 keywordLet = string "let" `notFollowedBy` alphaNumAReturns ¾ if there is no input left, ¿ if there is.B1Succeed only when at the end of the input stream.CJUses the passed parser, but succeeds only if it consumes all of the input.DOParse using the passed parser, but also return the input that was not consumed.EFlipped <?>.FYAnnotate the return value of the passed parser with the position just before parsing.GXAnnotate the return value of the passed parser with the position just after parsing.HpAnnotate the return value of the passed parser with the position just before and after parsing respectively..À½ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH: !"#$*+-,%&'()./0123456789:;<=>?@ABCDEFGH.À½ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHSafe-4ISynonym for parsers over the Á monad.JSynonym for lexers over the Á monad.K+The lexer and parser communicate using the K type.ˆLexemes carry position information as well as a payload. Generally, you will want to define a data type for the payload and use R9 to extract particular cases of payloads for parsing.LA parser: consumer of Ks MA lexer: producer of Ks N-Connect and run a lexer and parser together. OAs N in the Á monad. P)Wrap a normal parser into a parser for a KÂ. The passed parser determines the payload. Use this function at the boundary of the lexer and parser: when a complete lexeme has been recognized, but parsing has not been performed.]On failure, the resulting parser does not consume input, even if the passed parser would.QëDrop lexemes from the input stream whose payloads that satisfy the passed predicate. This is useful, for example, in whitespace-insensitive languages to remove extraneous whitespace so it need not clutter the parser definition.9WARNING: use only as the first action in a parsing monad.RJObtain a lexeme from the stream only if it satisfies the passed predicate.iThis is a very important function for building parsers. Generally, after defining your data type for Kb payloads, you will implement several combinators for recognizing each case of your data type.SUnpacks a payload from the KT stream and attempts to transform it. If the transformation fails (evaluates to Â), then this parser fails.TUnpacks a payload from the K5 stream. Only fails at the end of the lexeme stream. U.Succeed only at the end of the lexeme stream. VYDetect whether the parser is at the end of the lexeme stream without consuming input.IJKÃÄLMN2lexer: transform raw input stream into many tokens/parser: transform token stream into parsed dataO2lexer: transform raw input stream into many tokens/parser: transform token stream into parsed dataPQRSTUVÅÆÇÈÉIJKLMNOPQRSTUVMLKNJIOPQTSRUVIJKÃÄLMNOPQRSTUVÅÆÇÈÉSafe4NW5Determine how the depth of indentation is calculated.X}Any of the passed Chars can be used, but allow only one kind of character in a line. Depth is number of those characters.YyAllow any mix of of the passed Chars. Calculate depth by assigning a number to each of character by kind and summing.Zstring s* parses a sequence of characters given by s$. Returns the parsed string (i.e. sP). Unlike the Parsec version, this combinator never consumes input on failure. G adrenalineWord = string "fight" <|> string "flight"[DParse a single character, case-insensitive. Normalized to lowercase.\hParse a string, case-insensitive. If this parser fails, it consumes no input. Normalized to lowercase.]zParse a single char when it satisfies the predicate. Fails when the next input character does not satisfy the predicate.^Parse zero3 or more characters satisfying the predicate, c.f. _._Parse one3 or more characters satisfying the predicate, c.f. ^.`Rule UPALPHA from RFC2616 §2.2aRule LOALPHA from RFC2616 §2.2bRule ALPHA from RFC2616 §2.2cRule DIGIT from RFC2616 §2.2dParse a binary digit ('0' or '1')eRule CTL from RFC2616 §2.2f+A single printable ASCII character, as the TEXT rule from RFC2616 §2.2 g:A single printable unicode character, a generalization of text. See .hA carriage return (ASCII 13)iA line feed (ASCII 10)jA space (ASCII 32)kA horizonal tab (ASCII 9)lA single quotemA double quoten A colon (:)oA semicolon (;)p A period (.)q A comma (,)r Two dots (..)sThree dots (...)tXA backslash-escape: backslash followed by a single character satisfying the predicate.uParse "yes", "y", or "1" , case-insensitive. Return True.vParse "no", "n", or "0"!, case-insensitive. Return False.wParse u or v+ and return whether the answer was yes-ful.x'A carriage return + line feed sequence.yMShort for "linear whitespace": one or more spaces or tabs. Similar to rule LWS- from RFC2616 §2.2, but without line folding.zOParse a single line feed or carriage return. Does not succeed at end of file.{wRecognize when the parser is at a line break (LF, CR, or end of input) If the break is due to a CR or LF, consume it.| Parse a backslash followed by a z} Parse a backslash followed by a z, then linear whitespace (y ) and finally another backslash.~Parse a {H followed by whitespace characters. Return the depth of indentation.gThe acceptable whitespace characters and the method by whch to caclulate depth is determined by an  IntentPolicy.-WARNING: Do not use this combinator with the Lex3 module, it will break because Parsec is sissy.Ê Version of ~, suitable for us in lexing parsers built on Lex†This parser will not detect dedents at the end of input. Therefore, when you wish to recognize a dedent in your parser, recognize B# as well as your dedent tokens.zParse one or more characters that satisfy a predicate, but with additional restrictions on the first character parsed.3This is especially useful for identifiers (such as /[a-zA-Z_][a-zA-Z_0-9]*/,) and certain kinds of numbers (such as  /[1-9][0-9]*/).  identifier = œ "a-zA-Z0-9_" `many1Not` œ "0-9" naturalLiteral = ¢ 10 <$> œ "0-9" `many1Not` (=='0') €>Parse a sigil character immediately followed by an identifier. Jdata Sigil = Scalar | Array name = sigilized (zip "$@" [Scalar, Array]) $  (charClass' "_a-zA-Z0-9") (œ "0-9") )Parse between open and close parenthesis.‚.Parse between open and close square brackets ([...]).ƒ+Parse between open and close curly braces ({...}).„%Parse between open and close angles (<...>).…BParse a minus or plus sign and return the appropriate multiplier. †wParse "0x", "0o", or "0b" case-insensitive and return the appropriate base. If none of these parse, return base 10.‡KParse many digits in the passed base and return the corresponding integer. ˆJParse many digits in the passed base and return the appropriate rational. ‰>Parse a natural in the passed base and return its reciprocal. ŠOptional sign as …, defaults to positive.‹Parse an optional sign (as Š:), then a natural number of the specified base (as in ‡).Œ†Parse an integer: optional sign, then a number of digits. Bases 10, 16, 8 and 2 are supported with appropriate prefixes as in † before the digits.ÌParse a rational number: an optional sign, then two sequences of digits separated by a slash. Return the ratio of the appropriate sign between the two numbers. Bases 10, 16, 8 and 2 are supported.ŽwParse a number in scientific notation: an optional sign, then a radix mark, two sequences of digits separated by a pŠ, and finally an optional exponent, which is an exponent letter, an optional sign and finally one or more digits in the same base.tThe base of the exponent is the same as the base of the significand. In base ten, the exponent letter is either e or p!, but in other bases, it must be p (since e is already a hexdigit).WNote that digits are required on both sides of the (hexa)decimal point, so neither 0. nor .14 are recognized.%Parse a two-digit hexadacimal number.dParse a backslash and another character; use the passed table to determine the returned character.‘ACommon characetr escapes in programming language string literals: ÿ.\0 -> ASCII 00 (nul) \a -> ASCII 07 (alarm/bell) \b -> ASCII 08 (backspace) \e -> ASCII 1B (escape) \f -> ASCII 0C (form feed) \n -> ASCII 0A (line feed) \r -> ASCII 0D (carriage return) \t -> ASCII 09 (horizontal tab) \v -> ASCII 0B (vertical tab) \' -> single-quote \" -> double-quote \\ -> backslash’¤Escape sequences for any unicode code point. Represented by a backslash + one or more decimal digits. Fails when the code point is not representable in unicode.“[Escape sequences for bytes (including ASCII). Represented by a backslash + two hexdigits.”EEscape sequences in the Unicode Basic Multilingual Plane (BMP). C.f. •). Represented by a backslash+lowercase u followed by four hexdigits.•/Escape sequences outside the Unicode BMP. C.f. ”). Represented by a backslash+uppercase U? followed by five or six hexdigits totalling at most 0x10FFFF–A unicode escape, either as ” or •.—ŽParse a single-quoted string with no escape sequences, except that a single-quote in the string is encoded as two single-quote characters.ôThis is as single-quoted strings in SQL and Rc (the shell in Plan9). It is an excellent encoding for strings because they are so easy to validate from untrusted input and escape for rendering, whether it is done by human or machine.˜DParse a double-quoted string with common backslash escape sequences.We use > with the passed table of contents. There is no default table.Also, ’, “ and – are allowed. Further, the \&‚ stands for no character: it literally adds nothing to the string in which it appears, but it can be useful as in  "\127\&0".VFinally, lines can be folded with a backslash-newline-backslash, ignoring any yÉ between the newline and the second backslash. This is preferred over a simple backslash-newline, as it reduces any need to remember how leading whitespace is treated after a line-fold.The escapes parsed by Ü are preferred to the other escape sequences. Note that there are no escape sequences for backslash or double-quote by default (aside from a numerical escape), so you'll need to include them in the table for .™WParse a comment beginning with the passed string and ending at (but not including) a {.š~Parse a non-nesting comment beginning at the first passed string and ending with (and including) the second passed string.C.f ›.›Parse a nesting block comment.C.f. š.œMatch any character in a set. vowel = charClass "aeiou"Range notation is supported. !halfAlphabet = charClass "a-nA-N"To add a literal '-'> to a set, place it at the beginning or end of the string.RYou may also invert the set by placing a caret at the beginning of the string. nonVowel = "^aeiou"To add a literal '^'L to a set, place it somewhere other than at the beginning of the string.GThe class of printable unicode characters, including linear whitesapce.SAccepts: Letter, Number, Symbol, Space, Punctuation/Quote, Mark, Format, PrivateUseSDoes not Accept: LineSeparator, ParagraphSeparator, Control, Surrogate, NotAssignedžAccepts characters from 5, except those which satisfy the passed predicate.ŸÔAccepts a wide variety of unicode characters. This is the largest class of characters which might be used in a programming language that allows unicode identifiers, and probably include a little too much.8Accepts: Letter, Mark, Number, Punctuation/Quote, SymbolvDoes not Accept: Space, LineSeparator, ParagraphSeparator, Control, Format, Surrogate, PrivateUse, NotAssigned Accepts characters from Ÿ5, except those which satisfy the passed predicate.¡2Parse a digit in the passed base: 2, 8, 10 or 16. ¢5Interpret a string as an integer in the passed base. £5Interpret a string as a mantissa in the passed base. WWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÊË0Whether a character is allowed in the identifierWhether the character is  disallowed) as the first character of the identifier€,The sigils and their corresponding semanticsAn identifier parser‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™šStart the block commentEnd the block comment›Start a comment End a commentœžŸ ÌÍÎÏÐѡҢ£ÓS WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£S Z[\ ]^_`abc defghijklmnopqrstuvwyz{x|}WXY~€‚ƒ„…†‡ˆ‰Š‹¡¢£ŒŽ’“”•–‘—˜™š›œžŸ UWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÊË€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÌÍÎÏÐѡҢ£ÓSafewÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH Safe4¤¥ over the identity monad.¥-Type for Parsec parsers tracking indentation.¦'Opaque type tracking indentation state.§Create a starting IndentationStateS: indentation is initially enabled and the indentation depth stack starts with [0].¨TSucceed only when the indentation stack is suitably empty: is empty or equal to [0] , or if indentation is disabled.©&The most general way to run a parser. "runParserIT p state filePath input runs parser p on the input list of tokens input, obtained from source filePath with the initial user state stE. Indentation is initially enabled and the depth stack begins as [0] . The filePatho is only used in error messages and may be the empty string. Returns a computation in the underlying monad m that return either a  ParseError () or a value of type a ( ). ªAs ©, but over the Identity monad. « Shortcut for ©¬ Shortcut for ª­Parse an indent: as ~i ensuring the result is greater than the current indentation level. Pushes the indentation depth stack.®Parse an indent: as ~A ensuring the result is equal to the current indentation level.¯Parse an indent: as ~µ ensuring the result is less than the current indentation level. Pops the indentation depth stack. Consumes no input, thus multiple dedents might be parsed at a single position.°As ¯, but also consume the ®*. The leading whitespace is left intact.±Test if indentation is enabled.²IObtain the current indentation depth. Fails if indentation is disabled.³/Run the passed parser with indentation enabled.´0Run the passed parser with indentation disabled.µµTake a list of some linear whitespace tokens and return a parser that advances over linear whitespace and blank lines. Also, when indentation is disabled, also advance over {s.:You will almost always want to use this combinator before ­, ® and ¯Å to make sure indentation is always detected. Actual linear whitespace is usually not enough: remember to add parsers for comments as well. Line comments shouldn't eat the newline; the ™ combinator is acceptable.¶Alternate version of Parsec's getState* suited for indentation-sensitive parsers.·Alternate version of Parsec's  puttState* suited for indentation-sensitive parsers.¸Alternate version of Parsec's  modifyState* suited for indentation-sensitive parsers.¹ Peek the top of the depth stack.º;Pop the top of the depth stack and return the popped depth.»#Push to the top of the depth stack.¤¥¦    §¨©the parser to runEwhat characters count as leading space and how they should be counted#a list of linear whitespace parsersan initial user state9name of the source file from which the input was gathered input streamªthe parser to runEwhat characters count as leading space and how they should be counted#a list of linear whitespace parsersan initial user state9name of the source file from which the input was gathered input stream«¬­®¯°±²³´µ¶·¸¹º»YÔÕÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿWXY¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»$¥¤¦WXY©ª«¬µ­®¯°§¨±²³´¶·¸¹º»¤¥¦    §¨©ª«¬­®¯°±²³´µ¶·¸¹º»         !"#"$%&%'%(%)%*%+%,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊË ÌÍÎÏÐÎÏÑÒÓÔ Õ[ÖרÙÚÛÜÝÞßàáâãäåæçÈÇÆèéêëìíîïðñòóôõö÷øùúûüýþÿÍ      Òlutho_KsxjKioyLZB2qYexCsIugjText.Luthor.CombinatorText.Luthor.Syntax Text.LuthorText.Luthor.LexText.Luthor.IndentText.Parsec.Combinator optionMaybebaseGHC.Base<*>pure Data.Functorvoid<$><**><$<**>parse_8fSmqig53hOL2SEu1k9Tv0Text.Parsec.CharanyCharcharoctDigithexDigitnoneOfoneOfcountbetweenText.Parsec.Primtry<|> unexpectedText.Parsec.ErrorerrorPos ParseErrorText.Parsec.Pos sourceColumn sourceLine sourceName SourceNameLineColumn SourcePos<$$><||>choicedispatch longestOfoptionoptional optional_atLeastatMostmanyNMmanyOfmanyOf_manymany1many1_many_manyTillmanyThruchompbetween2sepBysepBy1sepEndBy sepEndBy1endByendBy1 sepAroundBy sepAroundBy1chainlchainl1chainrchainr1 lookAhead lookAhead_ notFollowedBy atEndOfInput endOfInputallInputwithRemainingInputexpect withPositionwithPositionEnd withPositionsLuthorLexLexemeLuthorTLexT runLuthorT runLuthorlexemeignoresatisfy unlexWithunlex endOfLexemesisAtEnd IndentPolicyDontMixConvertstringcharIstringIaCharmanyChar many1CharupAlphaloAlphaalphadigitbinDigitctl asciiTextuniTextcrlfsphtsqdqcolon semicolondotcomma ellipsis2 ellipsis3bsEscyesnoyesnocrlflwsnewline lineBreakbsnlbsnlwsbs dentationmany1Not sigilizedinParens inBracketsinBracesinAnglesnumSignnumBase numNatural numAfterPointnumDenominator numOptSign numIntegerintegerrational scientifichexOctet letterEsccEscapes decimalEscasciiEscloUniEschiUniEscuniEscsqStringdqString lineComment blockCommentnestingComment charClassuniPrint uniPrintMinusuniId uniIdMinusxDigitstringToIntegerstringToMantissaParsecIParsecIT IndentState startIndent endIndent runParserIT runParserIrunPITrunPIindentnextlinededentdedent'isIndentEnabledgetIndentDepthwithIndentationwithoutIndentation plusBlanklinegetStateputState modifyStatepeekIndentationpopIndentationpushIndentation AlternativeParsecTghc-prim GHC.TypesTrueFalseStreamData.Functor.IdentityIdentityNothing EndOfLexemes_lexShow _lexUpdatePos _lexPayload_lexPos_wrap lexDentation _dentation_upAlpha_loAlpha_alpha_digit _alphaNum _asciiControlxDigits$fIsStringParsecT updateStatesetStateupdateParserStatesetParserStategetParserStatesetInput setPositiongetInput getPosition parseTestparse runParser runParserTrunPrunPT manyAccumskipMany tokenPrimEx tokenPrimtokentokenslabelslabel parserPlus parserZero parserFailmergeErrorReply parserBind parserReturn parsecMapmkPT runParsecTsysUnExpectError unknownErrorParsecEmptyConsumedErrorOkReply stateUserstatePos stateInputStateuncons Data.EitherLeftRightIS_policy_depth_enabled_ws_prepForDentation_withIndentationSet