lzfZ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYSafe!"INA context-free grammar.The type parameters are:a*: The return type of the grammar (often a ).rI for rule: The type of a non-terminal. This plays a role similar to the s in the type ST s a . Since the parser function expects the rz to be universally quantified, there is not much to do with this parameter other than leaving it universally quantified.Most of the functionality of ,s is obtained through its instances, e.g. Z and [). Note that GHC has syntactic sugar for [: use {-# LANGUAGE RecursiveDo #-} and mdo instead of do. A production.The type parameters are:a$: The return type of the production.tJ for terminal: The type of the terminals that the production operates on.eN for expected: The type of names, used for example to report expected tokens.rI for rule: The type of a non-terminal. This plays a role similar to the s in the type ST s a . Since the parser function expects the rz to be universally quantified, there is not much to do with this parameter other than leaving it universally quantified.As an example,  r \ ] ^. is the type of a production that returns an ^0, operates on (lists of) characters and reports \ names.Most of the functionality of +s is obtained through its instances, e.g. _, `, and a. 4Match a token for which the given predicate returns Just a, and return the a. 8A named production (used for reporting expected things). #Smart constructor for alternatives.3Create a new non-terminal by giving its production.ZRun a grammar, given an action to perform on productions to be turned into non-terminals.b&String literals can be interpreted as s that match that string.:set -XOverloadedStringsimport Data.Text (Text)=let determiner = "the" <|> "a" <|> "an" :: Prod r e Text Text cdefbghij   cdefbghij NoneMMatch a token that satisfies the given predicate. Returns the matched token.Match a single token.7Match a single token and give it the name of the token.#Match a list of tokens in sequence.Match a k of tokens in sequence.None !"-DINDResults ready to be reported (when this position has been processed)&States to process at the next position<Computation that resets the continuation refs of productions.Named productions encountered at this position(The current position in the input stringThe input string The result of a parse.!The parser ended."The parser parsed a number of a's. These are given as a computation, l s [a] that constructs the aps when run. We can thus save some work by ignoring this computation if we do not care about the results. The ^F is the position in the input where these results were obtained, the iD the rest of the input, and the last component is the continuation.#A parsing report, which contains fields that are useful for presenting errors to the user if a parse is deemed a failure. Note however that we get a report even when we successfully parse something.%CThe final position in the input (0-based) that the parser reached.&7The named productions processed at the final position.'HThe part of the input string that was not consumed, which may be empty.,A continuation accepting an a and producing a b./!An Earley state with result type a.9+The concrete rule type that the parser uses@%Remove (some) nulls from a productionFRStrings of non-ambiguous continuations can be optimised by removing indirections.G,Given a grammar, construct an initial state.JThe internal parsing routineK'Create a parser from the given grammar.LaReturn all parses from the result of a given parser. The result may contain partial parses. The ^3s are the position at which a result was produced.MYReturn all parses that reached the end of the input from the result of a given parser.NSee e.g. how far the parser is able to parse the input string before it fails. This can be much faster than getting the parse results for highly ambiguous grammars.; !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ"States to process at this positionKLMNOPQR7 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN;9:;<=>?@8A567BRQPO234/01,-.()*+CDEFG#$%&' !"HIJKLMN !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRNone !"#$%&'KLMN #$%&' !"KLMNNone  !"#$%&'KLMN #$%&' !"KLMNNoneDS%An identifier with identifier parts (ms), and holes (n0s) representing the positions of its arguments.-Example (commonly written "if_then_else_"): [m "if", n, m "then", n, m "else", n] :: S \X0Create a grammar for parsing mixfix expressions.Y A version of X6 with a separate semantic action for each individual S identifier. STUVWopXA table of holey identifier parsers, with associativity information. The identifiers should be in groups of precedence levels listed from binding the least to the most tightly.The associativity is taken into account when an identifier starts or ends with holes, or both. Internal holes (e.g. after "if" in "if_then_else_") start from the beginning of the table.Note that this rule also applies to identifiers with multiple consecutive holes, e.g. "if__" --- the associativity then applies to both holes.An atom, i.e. what is parsed at the lowest level. This will commonly be a (non-mixfix) identifier or a parenthesised expression.eHow to combine the successful application of a holey identifier to its arguments into an expression.YA table of holey identifier parsers, with associativity information and semantic actions. The identifiers should be in groups of precedence levels listed from binding the least to the most tightly.The associativity is taken into account when an identifier starts or ends with holes, or both. Internal holes (e.g. after "if" in "if_then_else_") start from the beginning of the table.Note that this rule also applies to identifiers with multiple consecutive holes, e.g. "if__" --- the associativity then applies to both holes.An atom, i.e. what is parsed at the lowest level. This will commonly be a (non-mixfix) identifier or a parenthesised expression.STUVWXYTUVWSXYSTUVWopXYq      !"#$%&'())*+,--./0012234567789::;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\Z]^Z[_`ab`acZ[dZ[eZ[fghijklmnopqrZstZ[uZ[vwxyEarle_HT4hRODagP5FqvM4wQkZIaText.Earley.GrammarText.Earley.DerivedText.Earley.InternalText.Earley.MixfixText.Earley.Parser Text.EarleyGrammarRuleBindFixBindReturnProdTerminal NonTerminalPureAltsManyNamedterminalaltsrule runGrammarsatisfytoken namedTokenlistlistLikesymbol namedSymbolwordParseEnvresultsnextresetnamescurPosinputResultEndedParsedReportpositionexpected unconsumedContsconts contsArgsCont FinalContStateFinalBirthPosPreviousCurrentResults unResultsProdRRuleruleProd ruleConts ruleNullsmkRule prodNulls removeNulls resetConts lazyResultsnewConts contraMapCont contToState simplifyCont initialStatesafeHead emptyParseEnvparseparser allParses fullParsesreport$fMonoidResults$fMonadResults$fAlternativeResults$fApplicativeResultsHoley Associativity LeftAssocNonAssoc RightAssocmixfixExpressionmixfixExpressionSeparatebaseGHC.BaseMonadControl.Monad.FixMonadFixStringghc-prim GHC.TypesCharIntFunctor Applicative Alternative$fIsStringProd$fMonadFixGrammar$fMonadGrammar$fApplicativeGrammar$fFunctorGrammar$fAlternativeProd$fApplicativeProd $fFunctorProd $fMonoidProdListL_HAj7xV7Dp61GCoedJwTyx3Data.ListLike.BaseListLikeGHC.STSTJustNothing replicateAconsA