uoL      !"#$%&'()*+,-./0123456789:;<=>?@AB C D E F G H I J K  Safe-Inferred Safe-Inferred2468jEnables parsing on a per-character basis rather than per-token. For stream types where the token type is L already, this is trivial, but for other streams (e.g., bytestrings), some extra processing is required to perform a conversion to Unicode.Character-wise equivalent of  .. Returns a pair, where the first element is ME the parsed Unicode character, or Nothing on failure, and the second element is the number of tokens that the character has consumed. Generally, there are two reasons why parsing may fail: end-of-input, and a token sequence that does not represent a valid Unicode character according to the underlying stream's semantics.List-like types.AThis typeclass is pretty much required to do anything useful with Parcom; it is needed for Parcom to detect line endings so that parser errors will report the correct source positions. If you need to parse streams that do not support any meaningful concept of lines, consider implementing a dummy instance, like so: > instance Token Foobar where isLineDelimiter _ = False 4 This will treat the entire input as a single line. VTypeclass for types that are suitable as source streams. Note that implementing just  X gives you only a small subset of Parcom's features; if you want to implement your own  9 instances, you will most likely also want to implement $ for the corresponding token type, I to enable parsers that need to convert to or from lists of tokens, and - to enable parsers that work on Unicode text.Any list is trivially list-like$Unicode characters are valid tokens.All lists are instances of  \, and the corresponding token type is the list element type. Obviously, this also includes N ('[Char]') and '[Word8]'         Safe-InferredOO Safe-Inferred6  Safe-Inferred Safe-Inferred6 Safe-Inferred6  Safe-Inferred Safe-Inferred6 Safe-Inferred6 mParcom as a monad transformer. You can access the underlying monad stack using the usual lifting techniques. Parcom as a pure parserPThe parser's internal state.Q,Current source position, for error reportingRThe remaining source stream!A parser error.#'Human-readable description of the error$1Position in the source where the error was found.%LRepresents a position in a source file. Both lines and columns are 1-based.SRWrapper that handles setting up a sensible initial state before running a ParcomT*.Run a parcom transformer and return the result+.Run a pure parcom parser and return the resultTGet the internal parser stateU=Get the internal parser state and apply a projection functionV,Overwrite the internal parser state entirelyW:Apply a modification function to the internal parser stateXFWrap a raw parser with error and success handler functions, such that:2the handlers can choose whether to fail or succeedrthe handlers can choose to backtrack (by returning the previous state) or consume (by returning the new state).In order to facilitate this, both the error and success handler functions accept three arguments: the error or parsed value, respectively; the parser state before parsing; and the parser state after parsing.,Wrap a raw parser to allow handling success and failure. The error and success handlers take the error or parsed value, respectively, and return a parser that should be applied in the error or success case, respectively. No backtracking is performed.-Same as ,c, but backtrack on error (that is, if the raw parser fails, any input it has consumed is restored..hBacktracking modifier; restores the parser state to the previous situation if the wrapped parser fails.Y4Return the result of the first parser that succeeds./#Succeeds iff the given parser fails0QGets the next token from the stream without consuming it. Fails at end-of-input.1-Checks whether end-of-input has been reached.Z4Update a source position to proceed to the next line[6Update a source position to proceed to the next column2LGets the next token from the stream and consumes it. Fails at end-of-input.3Get one character from the stream, but do not consume it. Fails when the input stream contains a sequence that does not represent a valid character, or when the end of the input stream has been reached.4Get one character from the stream, and consume it. Fails when the input stream contains a sequence that does not represent a valid character, or when the end of the input stream has been reached.5Tags a parser with a human-readable description of the expected entity, generating an "Expected {entity}" type error message on failure.\(ParcomT enables lifting by implementing ]^SParcom is a monad. Obviously. Since the Parcom monad handles both failure through _ as well as carrying along its internal state, *and* supporting the transformed parent monad, the implementation is a tiny bit hairy.+`a PbQR!"#$%&'()S*+TUVWXThe parser we're wrapping error handlersuccess handler,-.Y/01Z[2345cde\^  !"#$%&'()*+,-./012345!"#$%&'()* +021.,-/5 34`a PbQR!"#$%&'()S*+TUVWX,-.Y/01Z[2345cde\^5 Safe-Inferred 6;Walk a list of options, return the first one that succeeds.7Like 6P, but each choice tagged with a human-readable name for better error reporting.8QMatch two consecutive parser, return the first parser's result iff both succeed.9Match three consecutive parsers, return the middle parser's result iff all three match. Parsers are given in the order inner, left, right.:*Match zero or more occurrences of a parser;)Match one or more occurrences of a parser<aGiven an item parser and a separator parser, keep parsing until the separator or the item fails.=BRun the given parser n times, returning all the results as a list.>Ignore the result of a parser.?Optional parsing to Maybe@Optional parsing with defaultA1Optional parsing, ignoring (but consuming) result 6789:;<=>?@A 6789:;<=>?@A 6789:;<=>?@A 6789:;<=>?@A  Safe-InferredB#Gets the next token from the streamC*Succeeds iff end-of-input has been reachedDZMatches one token against a list of possible tokens; returns the matching token or fails.E`Matches one token against a list of prohibited tokens; returns the non-matching token or fails.F:Succeeds if the given predicate is met for the next token.G"Exactly match one particular tokenH Match a series of tokens exactlyI)Match a series of tokens exactly. Unlike Hv, this parser accepts the target sequence by the stream's type instead of list-of-tokens. Depending on the stream's c implementation, this may be more efficient than matching and consuming the tokens one-by-one, as H does.BCDEFGHIBCDEFGHIBDECFGHIBCDEFGHI  Safe-InferredJKJKJKJK Safe-Inferred1  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIf !"#$%&$%&'()'()*+,,-.//0123456789:;<=>?@ABCDEFG H I J K L M N O P QRSTUVWX YZ[\]^_`abcdefghijkl*mZnopqparcom-lib-0.8.0.3Text.Parcom.CoreText.Parcom.InternalText.Parcom.StreamText.Parcom.ByteString.StrictText.Parcom.ByteString.LazyText.Parcom.Text.StrictText.Parcom.Text.LazyText.Parcom.CombinatorsText.Parcom.PrimText.Parcom.TextualText.Parcom.Word8Text.Parcom.ByteStringText.Parcom.Text Text.ParcombaseControl.Applicative<|>emptyformatOptionListTextishpeekCharListishtoListfromListTokenisLineDelimiterStreampeekatEndconsumepop $fTextish[] $fListish[]a $fTokenChar $fStream[]a$fTextishByteString$fListishByteStringWord8$fStreamByteStringWord8 $fTextishText$fListishTextChar$fStreamTextCharParcomTParcom ParcomErrorpeErrorDescriptionpeSourcePositionSourcePosition posFileNameposLine posColumnparseTparsehandlehandleBtry notFollowedBynextnextCharchoice namedChoicebeforebetweenmanymany1 manySepBytimesskippossiblyoptionaloptionanyTokeneofoneOfnoneOfsatisfytokentokensprefixstringcharghc-prim GHC.TypesChar Data.MaybeJustGHC.BaseString $fTokenWord8 ParcomStatepsSourcePositionpsStream runParserTgetStateuseStatesetState modifyStatehandle'altnextLine nextColumn$fMonadTransParcomTtransformers-0.3.0.0Control.Monad.Trans.Class MonadTrans$fMonadParcomT Data.EitherEither runParcomT$fAlternativeParcomT$fApplicativeParcomT$fFunctorParcomT