c7      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe%&OTA 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.  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 . 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.&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     0None %&2JOTDResults 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 string!The input string"The result of a parse.#The parser ended.$The parser parsed a number of a's. These are given as a computation,  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.1!An Earley state with result type a.;+The concrete rule type that the parser usesB%Remove (some) nulls from a productionHRStrings of non-ambiguous continuations can be optimised by removing indirections.I,Given a grammar, construct an initial state.LThe internal parsing routineM'Create a parser from the given grammar.NaReturn 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.The elements of the returned list of results are sorted by their position in ascending order. If there are multiple results at the same position they are returned in an unspecified order.OWReturn all parses that reached the end of the input from the result of a given parser.HIf there are multiple results they are returned in an unspecified order.PSee 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:;<=>?@ABCDEFGHIJKL"States to process at this positionMNOPQRST8 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP<;<=>?@AB:C789DTSRQ456123./0*+,-EFGHI%&'()"#$J !KLMNOP  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTNone "#$%&'()MNOP %&'()"#$MNOPNone %&2JOT_DResults ready to be reported (when this position has been processed)`&States to process at the next positiona<Computation that resets the continuation refs of productionsbThe possible tokenscThe result of a generator.dThe generator ended.e#The generator produced a number of a's. These are given as a computation,  s [a] that constructs the as when run. The n is the position in the input where these results were obtained, and the last component is the continuation.jA continuation accepting an a and producing a b.m!An Earley state with result type a.w.The concrete rule type that the generator uses~%Remove (some) nulls from a productionRStrings of non-ambiguous continuations can be optimised by removing indirections.,Given a grammar, construct an initial state.The internal generation routineICreate a language generator for given grammar and list of allowed tokens.7Run a generator, returning all members of the language.!The members are returned as parse results paired with the list of tokens used to produce the result. The elements of the returned list of results are sorted by their length in ascending order. If there are multiple results of the same length they are returned in an unspecified order. upTo n gen runs the generator genR, returning all members of the language that are of length less than or equal to n.!The members are returned as parse results paired with the list of tokens used to produce the result. The elements of the returned list of results are sorted by their length in ascending order. If there are multiple results of the same length they are returned in an unspecified order. exactly n gen runs the generator genE, returning all members of the language that are of length equal to n.The members are returned as parse results paired with the list of tokens used to produce the result. If there are multiple results they are returned in an unspecified order.5\]^_`abcdefghijklmnopqrstuvwxyz{|}~"States to process at this position1\]^a_`bcdefghijklmnopqrstuvwxyz{|}~5wxyz{|}~vstupqrmnojklfghicde]^_`ab\\]^_`abcdefghijklmnopqrstuvwxyz{|}~None\cdecde\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  of tokens in sequence.None "#$%&'()MNOP\ %&'()"#$MNOP\NoneJ%An identifier with identifier parts (s), and holes (0s) representing the positions of its arguments.-Example (commonly written "if_then_else_"): [ "if", ,  "then", ,  "else", ] ::  0Create a grammar for parsing mixfix expressions. A version of 6 with a separate semantic action for each individual  identifier. A 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.A 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.      !"##$%&'()*+,--./0112344566789:;;<=>>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^__$%&`*+a112344566789:;;<=>>?@ABCDEFGHIJKLbcdefgSTUVWX]hijklmnopqrstuvwxyz{y|}yz~yzyzyzyyyzyz&Earley-0.12.0.0-7pAjhaCWUkO8ti975VkvMfText.Earley.GrammarText.Earley.Parser.InternalText.Earley.Generator.InternalText.Earley.DerivedText.Earley.MixfixText.Earley.ParserText.Earley.Generator Text.EarleyGrammarRuleBindFixBindReturnProdTerminal NonTerminalPureAltsManyNamedterminalaltsrule runGrammar$fMonadFixGrammar$fMonadGrammar$fApplicativeGrammar$fFunctorGrammar$fIsStringProd$fAlternativeProd$fApplicativeProd $fFunctorProd $fMonoidProdParserParseEnvresultsnextresetnamescurPosinputResultEndedParsedReportpositionexpected unconsumedContsconts contsArgsCont FinalContStateFinalBirthPosPreviousCurrentResults unResultsProdRRuleruleProd ruleConts ruleNullsmkRule prodNulls removeNulls resetConts lazyResultsnewConts contraMapCont contToState simplifyCont initialStatesafeHead emptyParseEnvparseparser allParses fullParsesreport$fMonoidResults$fMonadResults$fAlternativeResults$fApplicativeResults$fFunctorResults $fEqBirthPos $fEqReport $fOrdReport $fReadReport $fShowReport$fFunctorResult Generator GenerationEnvtokens GeneratedemptyGenerationEnvgenerate generatorlanguageupToexactlysatisfytoken namedTokenlistlistLikesymbol namedSymbolwordHoley Associativity LeftAssocNonAssoc RightAssocmixfixExpressionmixfixExpressionSeparate$fEqAssociativity$fShowAssociativitybaseGHC.BaseMonadControl.Monad.FixMonadFixStringghc-prim GHC.TypesCharIntFunctor Applicative AlternativeGHC.STSTControl.Monad.ST.Lazy.Imp%ListLike-4.5.1-A4RJiv5B0Rd8Q6max6HJrMData.ListLike.BaseListLikeJustNothing replicateAconsA