This file is indexed.

/usr/share/doc/libghc-polyparse-doc/html/Text-ParserCombinators-Poly-Base.html is in libghc-polyparse-doc 1.12-3build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Text.ParserCombinators.Poly.Base</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Text-ParserCombinators-Poly-Base.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-ParserCombinators-Poly-Base.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">polyparse-1.12: A variety of alternative parser combinator libraries.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Text.ParserCombinators.Poly.Base</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The PolyParse classes</a></li><li><a href="#g:2">Combinators general to all parser types.</a><ul><li><a href="#g:3">Simple combinators</a></li><li><a href="#g:4">Error-handling</a></li><li><a href="#g:5">Choices</a></li><li><a href="#g:6">Sequences</a></li></ul></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span> <a href="#t:Commitment">Commitment</a> p <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:Monad">Monad</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Alternative">Alternative</a> p, <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> p) =&gt; <a href="#t:PolyParse">PolyParse</a> p</li><li class="src short"><a href="#v:apply">apply</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p (a -&gt; b) -&gt; p a -&gt; p b</li><li class="src short"><a href="#v:discard">discard</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p b -&gt; p a</li><li class="src short"><a href="#v:failBad">failBad</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; p a</li><li class="src short"><a href="#v:adjustErrBad">adjustErrBad</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; p a</li><li class="src short"><a href="#v:indent">indent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:oneOf">oneOf</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; [p a] -&gt; p a</li><li class="src short"><a href="#v:exactly">exactly</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; p a -&gt; p [a]</li><li class="src short"><a href="#v:upto">upto</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; p a -&gt; p [a]</li><li class="src short"><a href="#v:many1">many1</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p [a]</li><li class="src short"><a href="#v:sepBy">sepBy</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p sep -&gt; p [a]</li><li class="src short"><a href="#v:sepBy1">sepBy1</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p sep -&gt; p [a]</li><li class="src short"><a href="#v:bracketSep">bracketSep</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p bra -&gt; p sep -&gt; p ket -&gt; p a -&gt; p [a]</li><li class="src short"><a href="#v:bracket">bracket</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p bra -&gt; p ket -&gt; p a -&gt; p a</li><li class="src short"><a href="#v:manyFinally">manyFinally</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p z -&gt; p [a]</li><li class="src short"><a href="#v:manyFinally-39-">manyFinally'</a> :: (<a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) =&gt; p a -&gt; p z -&gt; p [a]</li></ul></div><div id="interface"><h1 id="g:1">The PolyParse classes</h1><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:Commitment" class="def">Commitment</a> p <span class="keyword">where</span> <a href="src/Text-ParserCombinators-Poly-Base.html#Commitment" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></p><div class="doc"><p>The <code>Commitment</code> class is an abstraction over all the current
   concrete representations of monadic/applicative 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.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Text-ParserCombinators-Poly-Base.html#v:commit">commit</a>, <a href="Text-ParserCombinators-Poly-Base.html#v:adjustErr">adjustErr</a>, <a href="Text-ParserCombinators-Poly-Base.html#v:oneOf-39-">oneOf'</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:commit" class="def">commit</a> :: p a -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><div class="doc"><p>Commit is a way of raising the severity of any errors found within
   its argument.  Used in the middle of a parser definition, it means that
   any operations prior to commitment fail softly, but after commitment,
   they fail hard.</p></div><p class="src"><a id="v:adjustErr" class="def">adjustErr</a> :: p a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><div class="doc"><p><code>p <code><a href="Text-ParserCombinators-Poly-Base.html#v:adjustErr">adjustErr</a></code> f</code> applies the transformation <code>f</code> to any error message
   generated in <code>p</code>, having no effect if <code>p</code> succeeds.</p></div><p class="src"><a id="v:oneOf-39-" class="def">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, p a)] -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p><div class="doc"><p>Parse the first alternative that succeeds, but if none succeed,
   report only the severe errors, and if none of those, then report
   all the soft errors.</p></div></div><div class="subs instances"><p id="control.i:Commitment" class="caption collapser" onclick="toggleSection('i:Commitment')">Instances</p><div id="section.i:Commitment" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:1" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:1')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-49" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a -&gt; <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a)] -&gt; <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:2" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:2')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-48" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a -&gt; <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a)] -&gt; <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:3" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:3')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-49" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a -&gt; <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a)] -&gt; <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a> a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:4" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:4')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-65" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a -&gt; <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a)] -&gt; <a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:5" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:5')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-55" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a -&gt; <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a)] -&gt; <a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:6" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:6')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-41" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a -&gt; <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a)] -&gt; <a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:7" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:7')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-55" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a -&gt; <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a)] -&gt; <a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:8" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:8')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-58" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a -&gt; <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a)] -&gt; <a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Commitment:Commitment:9" class="instance expander" onclick="toggleSection('i:ic:Commitment:Commitment:9')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-45" class="link">Source</a> <a href="#t:Commitment" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:Commitment:Commitment:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:commit">commit</a> :: <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#commit" class="link">Source</a> <a href="#v:commit" class="selflink">#</a></p><p class="src"><a href="#v:adjustErr">adjustErr</a> :: <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErr" class="link">Source</a> <a href="#v:adjustErr" class="selflink">#</a></p><p class="src"><a href="#v:oneOf-39-">oneOf'</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a)] -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf%27" class="link">Source</a> <a href="#v:oneOf-39-" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:Monad">Monad</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Alternative">Alternative</a> p, <a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> p) =&gt; <a id="t:PolyParse" class="def">PolyParse</a> p <a href="src/Text-ParserCombinators-Poly-Base.html#PolyParse" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></p><div class="doc"><p>The <code>PolyParse</code> class is an abstraction gathering all of the common
   features that a two-level error-handling parser requires:
   the applicative parsing interface, the monadic interface, and commitment.</p><p>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 <code>next</code> and <code>satisfy</code>.</p></div><div class="subs instances"><p id="control.i:PolyParse" class="caption collapser" onclick="toggleSection('i:PolyParse')">Instances</p><div id="section.i:PolyParse" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:1" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:1')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> <a href="Text-ParserCombinators-Poly-ByteString.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-84" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:1" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:2" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:2')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> <a href="Text-ParserCombinators-Poly-ByteStringChar.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-83" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:2" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:3" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:3')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> <a href="Text-ParserCombinators-Poly-Text.html#t:Parser">Parser</a></span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-84" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:3" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:4" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:4')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-Lex.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-114" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:4" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:5" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:5')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-Parser.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-53" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:5" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:6" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:6')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-Lazy.html#t:Parser">Parser</a> t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-83" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:6" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:7" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:7')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-StateText.html#t:Parser">Parser</a> s)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-90" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:7" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:8" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:8')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-56" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:8" class="inst-details hide"></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:PolyParse:PolyParse:9" class="instance expander" onclick="toggleSection('i:ic:PolyParse:PolyParse:9')"></span> <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</span> <a href="src/Text-ParserCombinators-Poly-Base.html#line-88" class="link">Source</a> <a href="#t:PolyParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:PolyParse:PolyParse:9" class="inst-details hide"></div></td></tr></table></div></div></div><h1 id="g:2">Combinators general to all parser types.</h1><h2 id="g:3">Simple combinators</h2><div class="top"><p class="src"><a id="v:apply" class="def">apply</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p (a -&gt; b) -&gt; p a -&gt; p b <span class="fixity">infixl 3</span><span class="rightedge"></span> <a href="src/Text-ParserCombinators-Poly-Base.html#apply" class="link">Source</a> <a href="#v:apply" class="selflink">#</a></p><div class="doc"><p>Apply a parsed function to a parsed value.
   Rather like ordinary function application lifted into parsers.</p></div></div><div class="top"><p class="src"><a id="v:discard" class="def">discard</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p b -&gt; p a <span class="fixity">infixl 3</span><span class="rightedge"></span> <a href="src/Text-ParserCombinators-Poly-Base.html#discard" class="link">Source</a> <a href="#v:discard" class="selflink">#</a></p><div class="doc"><p><code>x <code><a href="Text-ParserCombinators-Poly-Base.html#v:discard">discard</a></code> y</code> parses both x and y, but discards the result of y.
   Rather like <code>const</code> lifted into parsers.</p></div></div><h2 id="g:4">Error-handling</h2><div class="top"><p class="src"><a id="v:failBad" class="def">failBad</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#failBad" class="link">Source</a> <a href="#v:failBad" class="selflink">#</a></p><div class="doc"><p>When a simple fail is not strong enough, use failBad for emphasis.
   An emphasised (severe) error cannot be overridden by choice
   operators.</p></div></div><div class="top"><p class="src"><a id="v:adjustErrBad" class="def">adjustErrBad</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#adjustErrBad" class="link">Source</a> <a href="#v:adjustErrBad" class="selflink">#</a></p><div class="doc"><p><code>adjustErrBad</code> is just like <code>adjustErr</code> except it also raises the
   severity of the error.</p></div></div><div class="top"><p class="src"><a id="v:indent" class="def">indent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Text-ParserCombinators-Poly-Base.html#indent" class="link">Source</a> <a href="#v:indent" class="selflink">#</a></p><div class="doc"><p>Helper for formatting error messages: indents all lines by a fixed amount.</p></div></div><h2 id="g:5">Choices</h2><div class="top"><p class="src"><a id="v:oneOf" class="def">oneOf</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; [p a] -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#oneOf" class="link">Source</a> <a href="#v:oneOf" class="selflink">#</a></p><div class="doc"><p>Parse the first alternative in the list that succeeds.</p></div></div><h2 id="g:6">Sequences</h2><div class="top"><p class="src"><a id="v:exactly" class="def">exactly</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; p a -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#exactly" class="link">Source</a> <a href="#v:exactly" class="selflink">#</a></p><div class="doc"><p>'exactly n p' parses precisely n items, using the parser p, in sequence.</p></div></div><div class="top"><p class="src"><a id="v:upto" class="def">upto</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; p a -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#upto" class="link">Source</a> <a href="#v:upto" class="selflink">#</a></p><div class="doc"><p>'upto n p' parses n or fewer items, using the parser p, in sequence.</p></div></div><div class="top"><p class="src"><a id="v:many1" class="def">many1</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#many1" class="link">Source</a> <a href="#v:many1" class="selflink">#</a></p><div class="doc"><p>Parse a non-empty list of items.</p></div></div><div class="top"><p class="src"><a id="v:sepBy" class="def">sepBy</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p sep -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#sepBy" class="link">Source</a> <a href="#v:sepBy" class="selflink">#</a></p><div class="doc"><p>Parse a list of items separated by discarded junk.</p></div></div><div class="top"><p class="src"><a id="v:sepBy1" class="def">sepBy1</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p sep -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#sepBy1" class="link">Source</a> <a href="#v:sepBy1" class="selflink">#</a></p><div class="doc"><p>Parse a non-empty list of items separated by discarded junk.</p></div></div><div class="top"><p class="src"><a id="v:bracketSep" class="def">bracketSep</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p bra -&gt; p sep -&gt; p ket -&gt; p a -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#bracketSep" class="link">Source</a> <a href="#v:bracketSep" class="selflink">#</a></p><div class="doc"><p>Parse a list of items, discarding the start, end, and separator
   items.</p></div></div><div class="top"><p class="src"><a id="v:bracket" class="def">bracket</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p bra -&gt; p ket -&gt; p a -&gt; p a <a href="src/Text-ParserCombinators-Poly-Base.html#bracket" class="link">Source</a> <a href="#v:bracket" class="selflink">#</a></p><div class="doc"><p>Parse a bracketed item, discarding the brackets.
   If everything matches <em>except</em> the closing bracket, the whole
   parse fails soft, which can give less-than-satisfying error messages.
   If you want better error messages, try calling with e.g.
     <code>bracket open (commit close) item</code></p></div></div><div class="top"><p class="src"><a id="v:manyFinally" class="def">manyFinally</a> :: <a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p =&gt; p a -&gt; p z -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#manyFinally" class="link">Source</a> <a href="#v:manyFinally" class="selflink">#</a></p><div class="doc"><p><code>manyFinally e t</code> parses a possibly-empty sequence of <code>e</code>'s,
   terminated by a <code>t</code>.  The final <code>t</code> 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.</p></div></div><div class="top"><p class="src"><a id="v:manyFinally-39-" class="def">manyFinally'</a> :: (<a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> p, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) =&gt; p a -&gt; p z -&gt; p [a] <a href="src/Text-ParserCombinators-Poly-Base.html#manyFinally%27" class="link">Source</a> <a href="#v:manyFinally-39-" class="selflink">#</a></p><div class="doc"><p><code>manyFinally'</code> is like <code>manyFinally</code>, except when the terminator
   parser overlaps with the element parser.  In <code>manyFinally e t</code>,
   the parser <code>t</code> is tried only when parser <code>e</code> fails, whereas in
   <code>manyFinally' e t</code>, the parser <code>t</code> is always tried first, then
   parser <code>e</code> only if the terminator is not found.  For instance,
   <code>manyFinally (accept &quot;01&quot;) (accept &quot;0&quot;)</code> on input <code>&quot;0101010&quot;</code> returns
   <code>[&quot;01&quot;,&quot;01&quot;,&quot;01&quot;]</code>, whereas <code>manyFinally'</code> with the same arguments
   and input returns <code>[]</code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>