polyparse-1.0: docs/haddock/Text-ParserCombinators-HuttonMeijerWallace.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Text.ParserCombinators.HuttonMeijerWallace</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock.js" TYPE="text/javascript"
></SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>polyparse</TD
><TD CLASS="topbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html"
>Source code</A
></TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Text.ParserCombinators.HuttonMeijerWallace</FONT
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>The parser monad
</A
></DT
><DT
><A HREF="#2"
>Primitive parser combinators
</A
></DT
><DT
><A HREF="#3"
>Derived combinators
</A
></DT
><DT
><A HREF="#4"
>Error handling
</A
></DT
><DT
><A HREF="#5"
>State handling
</A
></DT
><DT
><A HREF="#6"
>Re-parsing
</A
></DT
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
>This library of monadic parser combinators is based on the ones
defined by Graham Hutton and Erik Meijer. It has been extended by
Malcolm Wallace to use an abstract token type (no longer just a
string) as input, and to incorporate a State Transformer monad, useful
for symbol tables, macros, and so on. Basic facilities for error
reporting have also been added, and later extended by Graham Klyne
to return the errors through an <TT
>Either</TT
> type, rather than just
calling <TT
>error</TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>newtype</SPAN
> <A HREF="#t%3AParser"
>Parser</A
> s t e a = <A HREF="#v%3AP"
>P</A
> (s -> [Either e t] -> ParseResult s t e a)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aitem"
>item</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e t</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aeof"
>eof</A
> :: Show p => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String ()</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Apapply"
>papply</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t String a -> s -> [Either String t] -> [(a, s, [Either String t])]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Apapply%27"
>papply'</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> s -> [Either e t] -> Either e [(a, s, [Either e t])]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%2B%2B%2B"
>(+++)</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Atok"
>tok</A
> :: Eq t => t -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e t</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Anottok"
>nottok</A
> :: Eq t => [t] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e t</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Amany"
>many</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Amany1"
>many1</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Asepby"
>sepby</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Asepby1"
>sepby1</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Achainl"
>chainl</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Achainl1"
>chainl1</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Achainr"
>chainr</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Achainr1"
>chainr1</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aops"
>ops</A
> :: [(<A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a, b)] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Abracket"
>bracket</A
> :: (Show p, Show t) => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e c -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e b</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtoEOF"
>toEOF</A
> :: Show p => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aelserror"
>elserror</A
> :: (Show p, Show t) => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a -> String -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Astupd"
>stupd</A
> :: (s -> s) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e ()</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Astquery"
>stquery</A
> :: (s -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Astget"
>stget</A
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e s</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Areparse"
>reparse</A
> :: [Either e t] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e ()</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
>The parser monad
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>newtype</SPAN
> <A NAME="t%3AParser"
></A
><B
>Parser</B
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#Parser"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v%3AP"
></A
><B
>P</B
> (s -> [Either e t] -> ParseResult s t e a)</TD
><TD CLASS="rdoc"
>The parser type is parametrised on the types of the state <TT
>s</TT
>,
the input tokens <TT
>t</TT
>, error-type <TT
>e</TT
>, and the result value <TT
>a</TT
>.
The state and remaining input are threaded through the monad.
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Parser')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Parser" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
>Functor (<A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e)</TD
></TR
><TR
><TD CLASS="decl"
>Monad (<A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e)</TD
></TR
><TR
><TD CLASS="decl"
>MonadPlus (<A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="2"
>Primitive parser combinators
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Aitem"
></A
><B
>item</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e t</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#item"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver the first remaining token.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Aeof"
></A
><B
>eof</B
> :: Show p => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String ()</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#eof"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Fail if end of input is not reached
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Apapply"
></A
><B
>papply</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t String a -> s -> [Either String t] -> [(a, s, [Either String t])]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#papply"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Apply the parser to some real input, given an initial state value.
If the parser fails, raise error to halt the program.
(This is the original exported behaviour - to allow the caller to
deal with the error differently, see <TT
>papply'</TT
>.)
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Apapply%27"
></A
><B
>papply'</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> s -> [Either e t] -> Either e [(a, s, [Either e t])]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#papply%27"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Apply the parser to some real input, given an initial state value.
If the parser fails, return a diagnostic message to the caller.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="3"
>Derived combinators
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3A%2B%2B%2B"
></A
><B
>(+++)</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#%2B%2B%2B"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>A choice between parsers. Keep only the first success.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Atok"
></A
><B
>tok</B
> :: Eq t => t -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e t</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#tok"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver the first token if it equals the argument.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Anottok"
></A
><B
>nottok</B
> :: Eq t => [t] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e t</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#nottok"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver the first token if it does not equal the argument.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Amany"
></A
><B
>many</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#many"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver zero or more values of <TT
>a</TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Amany1"
></A
><B
>many1</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#many1"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver one or more values of <TT
>a</TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Asepby"
></A
><B
>sepby</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#sepby"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver zero or more values of <TT
>a</TT
> separated by <TT
>b</TT
>'s.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Asepby1"
></A
><B
>sepby1</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e [a]</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#sepby1"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver one or more values of <TT
>a</TT
> separated by <TT
>b</TT
>'s.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Achainl"
></A
><B
>chainl</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#chainl"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Achainl1"
></A
><B
>chainl1</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#chainl1"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Achainr"
></A
><B
>chainr</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#chainr"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Achainr1"
></A
><B
>chainr1</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e (a -> a -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#chainr1"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Aops"
></A
><B
>ops</B
> :: [(<A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a, b)] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e b</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#ops"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Abracket"
></A
><B
>bracket</B
> :: (Show p, Show t) => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e b -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e c -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) e b</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#bracket"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3AtoEOF"
></A
><B
>toEOF</B
> :: Show p => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#toEOF"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Accept a complete parse of the input only, no partial parses.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="4"
>Error handling
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Aelserror"
></A
><B
>elserror</B
> :: (Show p, Show t) => <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a -> String -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s (p, t) String a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#elserror"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>If the parser fails, generate an error message.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="5"
>State handling
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Astupd"
></A
><B
>stupd</B
> :: (s -> s) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e ()</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#stupd"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Update the internal state.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Astquery"
></A
><B
>stquery</B
> :: (s -> a) -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e a</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#stquery"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Query the internal state.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Astget"
></A
><B
>stget</B
> :: <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e s</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#stget"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Deliver the entire internal state.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="6"
>Re-parsing
</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v%3Areparse"
></A
><B
>reparse</B
> :: [Either e t] -> <A HREF="Text-ParserCombinators-HuttonMeijerWallace.html#t%3AParser"
>Parser</A
> s t e ()</TD
><TD CLASS="declbut"
><A HREF="src/Text/ParserCombinators/HuttonMeijerWallace.html#reparse"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>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.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 0.8</TD
></TR
></TABLE
></BODY
></HTML
>