úÎShN´#      !"Safe!"INA context-free grammar.The type parameters are:a*: The return type of the grammar (often a ).e@: The type of names, used for example to report expected tokens.r?: 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 r„ 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.t<: The type of the terminals that the production operates on.e@: The type of names, used for example to report expected tokens.r?: 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 r„ 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 *. LMatch a token that satisfies the given predicate. Returns the matched token. 8A named production (used for reporting expected things). 3Create a new non-terminal by giving its production. +, -./01234    +, -./01234 None!"-INThe result of a parse.The parser ended.The parser parsed a number of a's. These are given as a computation, 5 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.6A continuation accepting an a and producing a b.7!An Earley state with result type a.8If we have something of type f, 8 s f a is what we need to do to f to produce as.9+The concrete rule type that the parser uses:TStrings of non-ambiguous continuations can be optimised by removing indirections.;Interpret an abstract .<,Given a grammar, construct an initial state.=The internal parsing routine'Create a parser from the given grammar.aReturn 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.YReturn all parses that reached the end of the input from the result of a given parser.§See 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.0>?@A6BC7DEF8G9HIJKLMNOPQRSTUVW:;<XY="States to process at this positionDResults 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  >?@A6BC7DEF8G9HIJKLMNOPQRSTUVW:;<XY=SafeMatch a single token.7Match a single token and give it the name of the token.#Match a list of tokens in sequence.None  NoneD%An identifier with identifier parts (Zs), and holes ([0s) representing the positions of its arguments.-Example (commonly written "if_then_else_"): [Z "if", Nothing, Z "then", Nothing, Z "else", Nothing] ::  %"0Create a grammar for parsing mixfix expressions. !"²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 a hole, or both. Internal holes (e.g. after "if" in "if_then_else_") start from the beginning of the table.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. !" !" !"\      !"#$%&'()*(+,()-./0./1()2()3()456789:;<=>(?@ABCDEFGHIIJKALBMNODPQRSTUVWXYZ[\]^_`()a()bcEarle_I5yAlzWXS42H5VwNAMhmXEText.Earley.GrammarText.Earley.ParserText.Earley.DerivedText.Earley.Mixfix Text.EarleyGrammarRuleBindFixBindReturnProdTerminal NonTerminalPureAltsManyNamedsatisfyruleResultEndedParsedReportpositionexpected unconsumedparser allParses fullParsesreportsymbol namedSymbolwordHoley Associativity LeftAssocNonAssoc RightAssocmixfixExpressionbaseGHC.BaseMonadControl.Monad.FixMonadFixStringghc-prim GHC.TypesCharIntFunctor Applicative Alternativealtsalts'$fMonadFixGrammar$fMonadGrammar$fApplicativeGrammar$fFunctorGrammar$fAlternativeProd$fApplicativeProd $fFunctorProd $fMonoidProdGHC.STSTContStateArgsRule simplifyContgrammar initialStateparseContsconts contsArgs FinalContFinalPosProdRruleProd ruleNullable ruleContsnullable nullableProd resetContsnoArgsfunArgpureArg impureArgsmapArgs composeArgsnewConts contraMapCont contToStatesafeHeadsafeTailJustNothing