polyparse5/home/jutaro/.leksah-0.8/packageSources/polyparse-1.4   Text.Parse src/Text/Parse.hs  Char Data.Char Data.Either Data.List Data.Maybe Data.TupleGHC.Base GHC.ClassesGHC.Integer.TypeGHC.ListGHC.Num GHC.OrderingGHC.ReadGHC.RealGHC.Show GHC.UnicodeListPreludeRatio Text.ParserCombinators.Poly! Text.ParserCombinators.Poly.Base"# PolyParse$ adjustErrBad%bracket& bracketSep'discard(exactly)failBad*indent+many,many1- manyFinally.oneOf/optional0sepBy1sepBy12!Text.ParserCombinators.Poly.Plain3 4$fFunctorParser5$fFunctorResult6 $fMonadParser7$fPolyParseParser8Parser9Result:eof;next<reparse= runParser>satisfy?Text.ParserCombinators.ReadP@ Text.ReadA]BParse a a CDIntB e e EFIntegerB h h GHFloatB k k IJDoubleB n n K B y y LMBoolB | | NOOrderingB   PQ()B  * RS(a, b)B  5 TU (a, b, c)B  # VWMaybe aB  1 XY Either a bB   Z[[a]Btclass Parse a parse :: TextParser a parsePrec :: Int -> TextParser a parseList :: TextParser [a]  4F;RThe class @Parse@ is a replacement for @Read@, operating over String input. Essentially, it permits better error messages for why something failed to parse. It is rather important that @parse@ can read back exactly what is generated by the corresponding instance of @show@. To apply a parser to some text, use @runParser@. \]parse TextParser a77^ parseListTextParser [a]@@_ parsePrecInt -> TextParser a<<$ 8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ `a%Text.ParserCombinators.Poly.StateLazybP:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a 8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ cd!Text.ParserCombinators.Poly.Stateb:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a 8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ ef Text.ParserCombinators.Poly.Lazyb/forall t a. ([t] -> Result [t] a) -> Parser t a 8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ g2b/forall t a. ([t] -> Result [t] a) -> Parser t a 8newtype Parser s t e a = P :: forall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a Stricts: _ hi*Text.ParserCombinators.HuttonMeijerWallacebLforall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a 8anewtype Parser a = P :: forall a. ([Token] -> [(a, [Token])]) -> Parser a Stricts: _ jk#Text.ParserCombinators.HuttonMeijerb1forall a. ([Token] -> [(a, [Token])]) -> Parser a 8snewtype Parser a = P :: forall a. (ByteString -> Result ByteString a) -> Parser a Stricts: _ lm&Text.ParserCombinators.Poly.ByteStringb9forall a. (ByteString -> Result ByteString a) -> Parser a #Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b n!opFunctorqMonadrscommitforall a. p a -> p at adjustErr*forall a. p a -> (String -> String) -> p auonFailforall a. p a -> p a -> p avoneOf' forall a. [(String, p a)] -> p awapply$forall a b. p (a -> b) -> p a -> p b 9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ `xySuccess)forall z s a. z -> s -> a -> Result z s azFailure.forall z s a. z -> s -> String -> Result z s a{ Committed,forall z s a. (Result z s a) -> Result z s a| 9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ cx| 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ e}y forall z a. z -> a -> Result z az%forall z a. z -> String -> Result z a{&forall z a. (Result z a) -> Result z a| 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ g}| 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ l}|~ TextParser&type TextParser a = Parser Char a  --!9A synonym for Parser Char, i.e. string input (no state)  $vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a n %kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a n %bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b h %Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b j &bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] n constructorsCconstructors :: forall a. [(String, TextParser a)] -> TextParser a  7Parse one of a bunch of alternative constructors. In the list argument, the first element of the pair is the constructor name, and the second is the parser for the rest of the value. The first matching parse is returned.  'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n enumerationAenumeration :: forall a. Show a => String -> [a] -> TextParser a  8Parse one of the given nullary constructors (an enumeration). The string argument is the name of the type, and the list argument should contain all of the possible enumeration values.  :!eof :: forall s t. Parser s t () ` :!eof :: forall s t. Parser s t () c :eof :: forall t. Parser t () e :eof :: forall t. Parser t () g :9eof :: forall p s t. Show p => Parser s (p, t) String () h :eof :: Parser () l (Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] n )>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a nfield5field :: forall a. Parse a => String -> TextParser a  *yDeal with named field syntax. The string argument is the field name, and the parser returns the value of the field.  *"indent :: Int -> String -> String nisWord&isWord :: String -> TextParser String  %Ensure that the next input word is the given string. (Note the input is lexed as haskell, so wordbreaks at spaces, symbols, etc.)  +:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n +;many :: forall s t e a. Parser s t e a -> Parser s t e [a] h +)many :: forall a. Parser a -> Parser [a] j ,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n , Parser s t e [a] h ,*many1 :: forall a. Parser a -> Parser [a] j -]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] ` -hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n ;!next :: forall s t. Parser s t t ` ;!next :: forall s t. Parser s t t c ;next :: forall t. Parser t t e ;next :: forall t. Parser t t g ;next :: Parser Char l .;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a n /Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) noptionalParens9optionalParens :: forall a. TextParser a -> TextParser a  .*Allow true string parens around an item. parens9parens :: forall a. Bool -> TextParser a -> TextParser a  .JAllow nested parens around an item (one set required when Bool is True).  parseByRead:parseByRead :: forall a. Read a => String -> TextParser a  KK/If there already exists a Read instance for a type, then we can make a Parser for it, but with only poor error-reporting. The string argument is the expected type or value (for error-reporting only). parseDec1parseDec :: forall a. Integral a => TextParser a  < parseFloat3parseFloat :: forall a. RealFrac a => TextParser a  *parseHex1parseHex :: forall a. Integral a => TextParser a  <parseInt{parseInt :: forall a. Integral a => String -> a -> (Char -> Bool) -> (Char -> Int) -> TextParser a  ( parseLitChar parseLitChar :: TextParser Char  parseOct1parseOct :: forall a. Integral a => TextParser a  < parseSigned@parseSigned :: forall a. Real a => TextParser a -> TextParser a  5 readByParse1readByParse :: forall a. TextParser a -> ReadS a  UU&{If you have a TextParser for a type, you can easily make it into a Read instance, by throwing away any error messages. readsPrecByParsePrecbreadsPrecByParsePrec :: forall a. (Int -> TextParser a) -> Int -> ReadS a  ]]?{If you have a TextParser for a type, you can easily make it into a Read instance, by throwing away any error messages.  <,reparse :: forall t s. [t] -> Parser s t () ` <,reparse :: forall t s. [t] -> Parser s t () c <(reparse :: forall t. [t] -> Parser t () e <(reparse :: forall t. [t] -> Parser t () g <9reparse :: forall e t s. [Either e t] -> Parser s t e () h <#reparse :: ByteString -> Parser () l =CrunParser :: forall s t a. Parser s t a -> s -> [t] -> (a, s, [t]) ` =^runParser :: forall s t a. Parser s t a -> s -> [t] -> (Either String a, s, [t]) c =7runParser :: forall t a. Parser t a -> [t] -> (a, [t]) e =RrunParser :: forall t a. Parser t a -> [t] -> (Either String a, [t]) g =\runParser :: forall a. Parser a -> ByteString -> (Either String a, ByteString) l >3satisfy :: forall t s. (t -> Bool) -> Parser s t t ` >3satisfy :: forall t s. (t -> Bool) -> Parser s t t c >/satisfy :: forall t. (t -> Bool) -> Parser t t e >/satisfy :: forall t. (t -> Bool) -> Parser t t g >)satisfy :: (Char -> Bool) -> Parser Char l 0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n 1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nwordword :: TextParser String  eeOne lexical chunk. This is Haskell'98-style lexing - the result should match Prelude.lex apart from better error-reporting. Text.Parse.ByteStringsrc/Text/Parse/ByteString.hs Data.ByteString.LazyData.ByteString.Lazy.Char8Data.ByteString.Lazy.Internal!"m 46789:;<=>?@`BG G CBJ J EBL L GBN N IBP P KBV V LBY Y NB] ] PBg g* RBo o5 TBy y# VB 1 XB  ZBtclass Parse a parse :: TextParser a parsePrec :: Int -> TextParser a parseList :: TextParser [a] ;M;RThe class @Parse@ is a replacement for @Read@, operating over String input. Essentially, it permits better error messages for why something failed to parse. It is rather important that @parse@ can read back exactly what is generated by the corresponding instance of @show@. To apply a parser to some text, use @runParser@. ] TextParser a>>^TextParser [a]GG_Int -> TextParser aCC$8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ `b:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ cb:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ eb/forall t a. ([t] -> Result [t] a) -> Parser t a8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ gb/forall t a. ([t] -> Result [t] a) -> Parser t a8newtype Parser s t e a = P :: forall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a Stricts: _ hbLforall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a8anewtype Parser a = P :: forall a. ([Token] -> [(a, [Token])]) -> Parser a Stricts: _ jb1forall a. ([Token] -> [(a, [Token])]) -> Parser a8snewtype Parser a = P :: forall a. (ByteString -> Result ByteString a) -> Parser a Stricts: _ lb9forall a. (ByteString -> Result ByteString a) -> Parser a#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ `x|9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ cx|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ e}|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ g}|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ l}|~!type TextParser a = Parser a 44EA synonym for a ByteString Parser, i.e. bytestring input (no state) $vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a nallAsByteString)allAsByteString :: TextParser ByteString (/Simply return the remaining input ByteString.  allAsString!allAsString :: TextParser String $0Simply return the remaining input as a String. %kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a n%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b h%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b j&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] nCconstructors :: forall a. [(String, TextParser a)] -> TextParser a 7Parse one of a bunch of alternative constructors. In the list argument, the first element of the pair is the constructor name, and the second is the parser for the rest of the value. The first matching parse is returned. 'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a nAenumeration :: forall a. Show a => String -> [a] -> TextParser a 8Parse one of the given nullary constructors (an enumeration). The string argument is the name of the type, and the list argument should contain all of the possible enumeration values. :!eof :: forall s t. Parser s t () `:!eof :: forall s t. Parser s t () c:eof :: forall t. Parser t () e:eof :: forall t. Parser t () g:9eof :: forall p s t. Show p => Parser s (p, t) String () h:eof :: Parser () l(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] n)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a n5field :: forall a. Parse a => String -> TextParser a *yDeal with named field syntax. The string argument is the field name, and the parser returns the value of the field. *"indent :: Int -> String -> String n&isWord :: String -> TextParser String ||%Ensure that the next input word is the given string. (Note the input is lexed as haskell, so wordbreaks at spaces, symbols, etc.) +:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] h+)many :: forall a. Parser a -> Parser [a] j,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n, Parser s t e [a] h,*many1 :: forall a. Parser a -> Parser [a] j-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;!next :: forall s t. Parser s t t `;!next :: forall s t. Parser s t t c;next :: forall t. Parser t t e;next :: forall t. Parser t t g;next :: Parser Char l.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a n/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n9optionalParens :: forall a. TextParser a -> TextParser a .*Allow true string parens around an item. 9parens :: forall a. Bool -> TextParser a -> TextParser a .JAllow nested parens around an item (one set required when Bool is True). :parseByRead :: forall a. Read a => String -> TextParser a TT/gIf there already exists a Read instance for a type, then we can make a Parser for it, but with only poor error-reporting. The string argument is the expected type or value (for error-reporting only). Use of this wrapper function is NOT recommended with ByteString, because there is a lot of inefficiency in repeated conversions to/from String. 1parseDec :: forall a. Integral a => TextParser a <3parseFloat :: forall a. RealFrac a => TextParser a *1parseHex :: forall a. Integral a => TextParser a <{parseInt :: forall a. Integral a => String -> a -> (Char -> Bool) -> (Char -> Int) -> TextParser a ( parseLitChar :: TextParser Char 1parseOct :: forall a. Integral a => TextParser a <@parseSigned :: forall a. Real a => TextParser a -> TextParser a 5parseUnsignedInteger+parseUnsignedInteger :: TextParser Integer *parseUnsignedInteger uses the underlying ByteString readInteger, so will be a lot faster than the generic character-by-character parseInt. 1readByParse :: forall a. TextParser a -> ReadS a ``& If you have a TextParser for a type, you can easily make it into a Read instance, by throwing away any error messages. Use of this wrapper function is NOT recommended with ByteString, because there is a lot of inefficiency in conversions to/from String. breadsPrecByParsePrec :: forall a. (Int -> TextParser a) -> Int -> ReadS a jj? If you have a TextParser for a type, you can easily make it into a Read instance, by throwing away any error messages. Use of this wrapper function is NOT recommended with ByteString, because there is a lot of inefficiency in conversions to/from String. <,reparse :: forall t s. [t] -> Parser s t () `<,reparse :: forall t s. [t] -> Parser s t () c<(reparse :: forall t. [t] -> Parser t () e<(reparse :: forall t. [t] -> Parser t () g<9reparse :: forall e t s. [Either e t] -> Parser s t e () h<#reparse :: ByteString -> Parser () l=CrunParser :: forall s t a. Parser s t a -> s -> [t] -> (a, s, [t]) `=^runParser :: forall s t a. Parser s t a -> s -> [t] -> (Either String a, s, [t]) c=7runParser :: forall t a. Parser t a -> [t] -> (a, [t]) e=RrunParser :: forall t a. Parser t a -> [t] -> (Either String a, [t]) g=\runParser :: forall a. Parser a -> ByteString -> (Either String a, ByteString) l>3satisfy :: forall t s. (t -> Bool) -> Parser s t t `>3satisfy :: forall t s. (t -> Bool) -> Parser s t t c>/satisfy :: forall t. (t -> Bool) -> Parser t t e>/satisfy :: forall t. (t -> Bool) -> Parser t t g>)satisfy :: (Char -> Bool) -> Parser Char l0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nword :: TextParser String rr+One lexical chunk (Haskell-style lexing). j*src/Text/ParserCombinators/HuttonMeijer.hs  Control.MonadGHC.Enumq&+++2+++ :: forall a. Parser a -> Parser a -> Parser a j[[5pj1 1 8qj5 5  MonadPlusj? ? 8anewtype Parser a = P :: forall a. ([Token] -> [(a, [Token])]) -> Parser a Stricts: _ j//1The parser monad b1forall a. ([Token] -> [(a, [Token])]) -> Parser a//1alphanumalphanum :: Parser Char j %Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b jAchainlPchainl :: forall a. Parser a -> Parser (a -> a -> a) -> a -> Parser a jqqFchainl1Bchainl1 :: forall a. Parser a -> Parser (a -> a -> a) -> Parser a jttAchainrPchainr :: forall a. Parser a -> Parser (a -> a -> a) -> a -> Parser a jzzFchainr1Bchainr1 :: forall a. Parser a -> Parser (a -> a -> a) -> Parser a j}}Acharchar :: Char -> Parser Char j(commentcomment :: Parser () jdigitdigit :: Parser Char j first(first :: forall a. Parser a -> Parser a jOO)identident :: Parser String j" identifier(identifier :: [String] -> Parser String j.intint :: Parser Int jintegerinteger :: Parser Int jitemitem :: Parser Token jJJ"junkjunk :: Parser () jletterletter :: Parser Char j lowerlower :: Parser Char j +)many :: forall a. Parser a -> Parser [a] jdd+,*many1 :: forall a. Parser a -> Parser [a] jhh+natnat :: Parser Int jnaturalnatural :: Parser Int jops/ops :: forall a b. [(Parser a, b)] -> Parser b j0papply:papply :: forall a. Parser a -> [Token] -> [(a, [Token])] jTT9sat'sat :: (Token -> Bool) -> Parser Token j^^4sepby8sepby :: forall a b. Parser a -> Parser b -> Parser [a] jkk7sepby19sepby1 :: forall a b. Parser a -> Parser b -> Parser [a] jnn7skip'skip :: forall a. Parser a -> Parser a j)spacesspaces :: Parser () jstring"string :: String -> Parser String j,symbol"symbol :: String -> Parser String j,token(token :: forall a. Parser a -> Parser a j)upperupper :: Parser Char j h1src/Text/ParserCombinators/HuttonMeijerWallace.hs qQ+++ :: forall s t e a. Parser s t e a -> Parser s t e a -> Parser s t e a hG9A choice between parsers. Keep only the first success. phF F  Parser s t eqhM M hZ Z! 8newtype Parser s t e a = P :: forall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a Stricts: _ hAAIbLforall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e aAAI The parser type is parametrised on the types of the state @s@, the input tokens @t@, error-type @e@, and the result value @a@. The state and remaining input are threaded through the monad.%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b hGhchainl :: forall s t e a. Parser s t e a -> Parser s t e (a -> a -> a) -> a -> Parser s t e a hOechainl1 :: forall s t e a. Parser s t e a -> Parser s t e (a -> a -> a) -> Parser s t e a hOhchainr :: forall s t e a. Parser s t e a -> Parser s t e (a -> a -> a) -> a -> Parser s t e a hOechainr1 :: forall s t e a. Parser s t e a -> Parser s t e (a -> a -> a) -> Parser s t e a hOelserrorelserror :: forall p t s a. (Show p, Show t) => Parser s (p, t) String a -> String -> Parser s (p, t) String a h  B1If the parser fails, generate an error message. :9eof :: forall p s t. Show p => Parser s (p, t) String () h||7%Fail if end of input is not reached %item :: forall s t e. Parser s t e t htt#$Deliver the first remaining token. +;many :: forall s t e a. Parser s t e a -> Parser s t e [a] h7%Deliver zero or more values of @a@. , Parser s t e [a] h7$Deliver one or more values of @a@. nottok=nottok :: forall t s p e. Eq t => [t] -> Parser s (p, t) e t h6 Parser s t e b h<papply :: forall s t a. Parser s t String a -> s -> [Either String t] -> [(a, s, [Either String t])] hJApply the parser to some real input, given an initial state value. If the parser fails, raise 'GHC.Err.error' to halt the program. (This is the original exported behaviour - to allow the caller to deal with the error differently, see @papply'@.) papply'papply' :: forall s t e a. Parser s t e a -> s -> [Either e t] -> Either e [(a, s, [Either e t])] hIApply the parser to some real input, given an initial state value. If the parser fails, return a diagnostic message to the caller. <9reparse :: forall e t s. [Either e t] -> Parser s t e () h&&-This is useful for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. Ysepby :: forall s t e a b. Parser s t e a -> Parser s t e b -> Parser s t e [a] hI8Deliver zero or more values of @a@ separated by @b@'s. [sepby1 :: forall s t e a b. Parser s t e a -> Parser s t e b -> Parser s t e [a] hI7Deliver one or more values of @a@ separated by @b@'s. stget&stget :: forall s t e. Parser s t e s h$Deliver the entire internal state. stquery6stquery :: forall s a t e. (s -> a) -> Parser s t e a h&Query the internal state. stupd3stupd :: forall s t e. (s -> s) -> Parser s t e () h'Update the internal state. toEOFjtoEOF :: forall p s t a. Show p => Parser s (p, t) String a -> Parser s (p, t) String a hG?Accept a complete parse of the input only, no partial parses. tok8tok :: forall t s p e. Eq t => t -> Parser s (p, t) e t h44Deliver the first token if it equals the argument.  "src/Text/ParserCombinators/Poly.hs!"289:;<=>=8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ `b:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ cb:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ eb/forall t a. ([t] -> Result [t] a) -> Parser t a8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ gb/forall t a. ([t] -> Result [t] a) -> Parser t a8newtype Parser s t e a = P :: forall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a Stricts: _ hbLforall s t e a. (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a8anewtype Parser a = P :: forall a. ([Token] -> [(a, [Token])]) -> Parser a Stricts: _ jb1forall a. ([Token] -> [(a, [Token])]) -> Parser a8snewtype Parser a = P :: forall a. (ByteString -> Result ByteString a) -> Parser a Stricts: _ lb9forall a. (ByteString -> Result ByteString a) -> Parser a#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ `x|9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ cx|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ e}|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ g}|9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ l}|$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a n%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a n%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b h%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b j&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] n'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:!eof :: forall s t. Parser s t () `:!eof :: forall s t. Parser s t () c:eof :: forall t. Parser t () e:eof :: forall t. Parser t () g:9eof :: forall p s t. Show p => Parser s (p, t) String () h:eof :: Parser () l(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] n)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a n*"indent :: Int -> String -> String n+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] h+)many :: forall a. Parser a -> Parser [a] j,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n, Parser s t e [a] h,*many1 :: forall a. Parser a -> Parser [a] j-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;!next :: forall s t. Parser s t t `;!next :: forall s t. Parser s t t c;next :: forall t. Parser t t e;next :: forall t. Parser t t g;next :: Parser Char l.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a n/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<,reparse :: forall t s. [t] -> Parser s t () `<,reparse :: forall t s. [t] -> Parser s t () c<(reparse :: forall t. [t] -> Parser t () e<(reparse :: forall t. [t] -> Parser t () g<9reparse :: forall e t s. [Either e t] -> Parser s t e () h<#reparse :: ByteString -> Parser () l=CrunParser :: forall s t a. Parser s t a -> s -> [t] -> (a, s, [t]) `=^runParser :: forall s t a. Parser s t a -> s -> [t] -> (Either String a, s, [t]) c=7runParser :: forall t a. Parser t a -> [t] -> (a, [t]) e=RrunParser :: forall t a. Parser t a -> [t] -> (Either String a, [t]) g=\runParser :: forall a. Parser a -> ByteString -> (Either String a, ByteString) l>3satisfy :: forall t s. (t -> Bool) -> Parser s t t `>3satisfy :: forall t s. (t -> Bool) -> Parser s t t c>/satisfy :: forall t. (t -> Bool) -> Parser t t e>/satisfy :: forall t. (t -> Bool) -> Parser t t g>)satisfy :: (Char -> Bool) -> Parser Char l0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nn'src/Text/ParserCombinators/Poly/Base.hs#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b n+B9The @PolyParse@ class is an abstraction over all the current concrete representations of monadic parser combinators in this package. The common feature is two-level error-handling. Some primitives must be implemented specific to each parser type (e.g. depending on whether the parser has a running state, or whether it is lazy). But given those primitives, large numbers of combinators do not depend any further on the internal structure of the particular parser. There are two additional basic combinators that we expect to be implemented afresh for every concrete type, but which (for technical reasons) cannot be class methods. They are @next@ and @satisfy@. ot*forall a. p a -> (String -> String) -> p a331w$forall a b. p (a -> b) -> p a -> p bAA'sforall a. p a -> p a00uforall a. p a -> p a -> p a::"v forall a. [(String, p a)] -> p a>>'$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a ngg=]@adjustErrBad@ is just like @adjustErr@ except it also raises the severity of the error. %kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a n62Parse a bracketed item, discarding the brackets. &bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] nDKParse a list of items, discarding the start, end, and separator items. 'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a nbb+@x 'Text.ParserCombinators.Poly.Base.discard' y@ parses both x and y, but discards the result of y. Rather like @const@ lifted into parsers. (Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] n~~-J'exactly n p' parses precisely n items, using the parser p, in sequence. )>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a n]]'When a simple fail is not strong enough, use failBad for emphasis. An emphasised (severe) error cannot be overridden by choice operators. *"indent :: Int -> String -> String nvv!LHelper for formatting error messages: indents all lines by a fixed amount. +:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n#{'many p' parses a list of elements with individual parser p. Cannot fail, since an empty list is a valid return value. ,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n$"Parse a non-empty list of items. -hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n1'manyFinally e t' parses a possibly-empty sequence of e's, terminated by a t. The final t is discarded. Any parse failures could be due either to a badly-formed terminator or a badly-formed element, so it raises both possible errors. .;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a nkk$8Parse the first alternative in the list that succeeds. /Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) nzz-l'Text.ParserCombinators.Poly.Base.optional' indicates whether the parser succeeded through the Maybe type. 0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n-4Parse a list of items separated by discarded junk. 1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n.>Parse a non-empty list of items separated by discarded junk. l-src/Text/ParserCombinators/Poly/ByteString.hs !"!pl# # Result zpl1 1 ql4 4 8snewtype Parser a = P :: forall a. (ByteString -> Result ByteString a) -> Parser a Stricts: _ l8This @Parser@ datatype is a fairly generic parsing monad with error reporting. It can be used for arbitrary token types, not just String input. (If you require a running state, use module PolyState instead) b9forall a. (ByteString -> Result ByteString a) -> Parser a8l#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor#l> > 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ l!(A return type like Either, that distinguishes not only between right and wrong answers, but also has commitment, so that a failure cannot be undone. This should only be used for writing very primitive parsers - really it is an internal detail of the library. {&forall z a. (Result z a) -> Result z a!!(z%forall z a. z -> String -> Result z a  $y forall z a. z -> a -> Result z a|l$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a nl%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a nl%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b hl%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b jl&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] nl'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:eof :: Parser () l__l(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] nl)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a nl*"indent :: Int -> String -> String nl+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] nl+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] hl+)many :: forall a. Parser a -> Parser [a] jl,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] nl, Parser s t e [a] hl,*many1 :: forall a. Parser a -> Parser [a] jl-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `l-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;next :: Parser Char lZZl.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a nl/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<#reparse :: ByteString -> Parser () loo%5Push some tokens back onto the front of the input stream and reparse. This is useful e.g. for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. =\runParser :: forall a. Parser a -> ByteString -> (Either String a, ByteString) l))D,Apply a parser to an input token sequence. >)satisfy :: (Char -> Bool) -> Parser Char ldd(l0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nl1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] ne'src/Text/ParserCombinators/Poly/Lazy.hsControl.Exception GHC.Exception!"!pe, , pe: : Parser tqe= = 8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ e"",This @Parser@ datatype is a fairly generic parsing monad with error reporting. It can be used for arbitrary token types, not just String input. (If you require a running state, use module PolyState instead) b/forall t a. ([t] -> Result [t] a) -> Parser t a"",e#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor#eG G 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ e(*)A return type like Either, that distinguishes not only between right and wrong answers, but also has gradations of wrongness. This should only be used for writing very primitive parsers - really it is an internal detail of the library. {&forall z a. (Result z a) -> Result z a**)z%forall z a. z -> String -> Result z a))%y forall z a. z -> a -> Result z a(( |e$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a ne%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a ne%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b he%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b je&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] ne'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:eof :: forall t. Parser t () ette(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] ne)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a ne*"indent :: Int -> String -> String ne+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] ne+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] he+)many :: forall a. Parser a -> Parser [a] je,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] ne, Parser s t e [a] he,*many1 :: forall a. Parser a -> Parser [a] je-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `e-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;next :: forall t. Parser t t eooe.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a ne/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<(reparse :: forall t. [t] -> Parser t () e 5Push some tokens back onto the front of the input stream and reparse. This is useful e.g. for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. =7runParser :: forall t a. Parser t a -> [t] -> (a, [t]) e22*,Apply a parser to an input token sequence. >/satisfy :: forall t. (t -> Bool) -> Parser t t eyy"e0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] ne1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] ng(src/Text/ParserCombinators/Poly/Plain.hs!"!pg" " pg0 0 qg3 3 8anewtype Parser t a = P :: forall t a. ([t] -> Result [t] a) -> Parser t a Stricts: _ g,This @Parser@ datatype is a fairly generic parsing monad with error reporting. It can be used for arbitrary token types, not just String input. (If you require a running state, use module PolyState instead) b/forall t a. ([t] -> Result [t] a) -> Parser t a,g#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor#g= = 9data Result z a = Success :: forall z a. z -> a -> Result z a Stricts: _ _ | Failure :: forall z a. z -> String -> Result z a Stricts: _ _ | Committed :: forall z a. (Result z a) -> Result z a Stricts: _ g (A return type like Either, that distinguishes not only between right and wrong answers, but also has commitment, so that a failure cannot be undone. This should only be used for writing very primitive parsers - really it is an internal detail of the library. {&forall z a. (Result z a) -> Result z a  (z%forall z a. z -> String -> Result z a$y forall z a. z -> a -> Result z a|g$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a ng%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a ng%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b hg%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b jg&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] ng'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:eof :: forall t. Parser t () g^^g(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] ng)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a ng*"indent :: Int -> String -> String ng+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] ng+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] hg+)many :: forall a. Parser a -> Parser [a] jg,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] ng, Parser s t e [a] hg,*many1 :: forall a. Parser a -> Parser [a] jg-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `g-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;next :: forall t. Parser t t gYYg.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a ng/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<(reparse :: forall t. [t] -> Parser t () gnn 5Push some tokens back onto the front of the input stream and reparse. This is useful e.g. for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. =RrunParser :: forall t a. Parser t a -> [t] -> (Either String a, [t]) g((8,Apply a parser to an input token sequence. >/satisfy :: forall t. (t -> Bool) -> Parser t t gcc"g0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] ng1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nc(src/Text/ParserCombinators/Poly/State.hs$pc% %  Result z spc3 3  Parser s tqc6 6 8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ c5This @Parser@ datatype is a fairly generic parsing monad with error reporting. It can be used for arbitrary token types, not just String input. (If you require a running state, use module PolyState instead) b:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a5c#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor#c@ @ 9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ c!#-A return type like Either, that distinguishes not only between right and wrong answers, but also has gradations of wrongness. This should only be used for writing very primitive parsers - really it is an internal detail of the library. {,forall z s a. (Result z s a) -> Result z s a##-z.forall z s a. z -> s -> String -> Result z s a"")y)forall z s a. z -> s -> a -> Result z s a!!$|c$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a nc%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a nc%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b hc%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b jc&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] nc'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:!eof :: forall s t. Parser s t () caac(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] nc)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a nc*"indent :: Int -> String -> String nc+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] nc+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] hc+)many :: forall a. Parser a -> Parser [a] jc,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] nc, Parser s t e [a] hc,*many1 :: forall a. Parser a -> Parser [a] jc-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `c-hmanyFinally :: forall (p::* -> *) a z. PolyParse p => p a -> p z -> p [a] n;!next :: forall s t. Parser s t t c\\c.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a nc/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<,reparse :: forall t s. [t] -> Parser s t () c"5Push some tokens back onto the front of the input stream and reparse. This is useful e.g. for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. =^runParser :: forall s t a. Parser s t a -> s -> [t] -> (Either String a, s, [t]) c++B,Apply a parser to an input token sequence. >3satisfy :: forall t s. (t -> Bool) -> Parser s t t cgg$c0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nc1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] nstGet"stGet :: forall s t. Parser s t s cww$Deliver the entire internal state. stQuery2stQuery :: forall s a t. (s -> a) -> Parser s t a css$Query the internal state. stUpdate2stUpdate :: forall s t. (s -> s) -> Parser s t () coo%Update the internal state. `,src/Text/ParserCombinators/Poly/StateLazy.hs!#$%&'()*+,./01#p`0 0 p`> > q`A A 8xnewtype Parser s t a = P :: forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a Stricts: _ `&&5This @Parser@ datatype is a fairly generic parsing monad with error reporting. It can be used for arbitrary token types, not just String input. (If you require a running state, use module PolyState instead) b:forall s t a. (s -> [t] -> Result [t] s a) -> Parser s t a&&5`#Iclass (Functor p, Monad p) => PolyParse (p::* -> *) commit :: forall a. p a -> p a adjustErr :: forall a. p a -> (String -> String) -> p a onFail :: forall a. p a -> p a -> p a oneOf' :: forall a. [(String, p a)] -> p a apply :: forall a b. p (a -> b) -> p a -> p b nor#`K K 9 data Result z s a = Success :: forall z s a. z -> s -> a -> Result z s a Stricts: _ _ _ | Failure :: forall z s a. z -> s -> String -> Result z s a Stricts: _ _ _ | Committed :: forall z s a. (Result z s a) -> Result z s a Stricts: _ `,.-A return type like Either, that distinguishes not only between right and wrong answers, but also has gradations of wrongness. This should only be used for writing very primitive parsers - really it is an internal detail of the library. {,forall z s a. (Result z s a) -> Result z s a..-z.forall z s a. z -> s -> String -> Result z s a--)y)forall z s a. z -> s -> a -> Result z s a,,$|`$vadjustErrBad :: forall (p::* -> *) a. PolyParse p => p a -> (String -> String) -> p a n`%kbracket :: forall (p::* -> *) bra ket a. PolyParse p => p bra -> p ket -> p a -> p a n`%bracket :: forall p t s e a b c. (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b h`%Qbracket :: forall a b c. Parser a -> Parser b -> Parser c -> Parser b j`&bracketSep :: forall (p::* -> *) bra sep ket a. PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] n`'Ddiscard :: forall (p::* -> *) a b. PolyParse p => p a -> p b -> p a n:!eof :: forall s t. Parser s t () ``(Dexactly :: forall (p::* -> *) a. PolyParse p => Int -> p a -> p [a] n`)>failBad :: forall (p::* -> *) a. PolyParse p => String -> p a n`*"indent :: Int -> String -> String n`+:many :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n`+;many :: forall s t e a. Parser s t e a -> Parser s t e [a] h`+)many :: forall a. Parser a -> Parser [a] j`,;many1 :: forall (p::* -> *) a. PolyParse p => p a -> p [a] n`, Parser s t e [a] h`,*many1 :: forall a. Parser a -> Parser [a] j-]manyFinally :: forall s t a z. Parser s t a -> Parser s t z -> Parser s t [a] `qq=;!next :: forall s t. Parser s t t ``.;oneOf :: forall (p::* -> *) a. PolyParse p => [p a] -> p a n`/Doptional :: forall (p::* -> *) a. PolyParse p => p a -> p (Maybe a) n<,reparse :: forall t s. [t] -> Parser s t () `"5Push some tokens back onto the front of the input stream and reparse. This is useful e.g. for recursively expanding macros. When the user-parser recognises a macro use, it can lookup the macro expansion from the parse state, lex it, and then stuff the lexed expansion back down into the parser. =CrunParser :: forall s t a. Parser s t a -> s -> [t] -> (a, s, [t]) `664,Apply a parser to an input token sequence. >3satisfy :: forall t s. (t -> Bool) -> Parser s t t `$`0ZsepBy :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n`1]sepBy1 :: forall (p::* -> *) a sep. PolyParse p => p a -> p sep -> p [a] n"stGet :: forall s t. Parser s t s `$Deliver the entire internal state. 2stQuery :: forall s a t. (s -> a) -> Parser s t a `$Query the internal state. 2stUpdate :: forall s t. (s -> s) -> Parser s t () `%Update the internal state.