This file is indexed.

/usr/share/doc/libghc-polyparse-doc/html/Text-ParserCombinators-Poly-StateLazy.html is in libghc-polyparse-doc 1.7-1.

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.StateLazy</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Text-ParserCombinators-Poly-StateLazy.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-ParserCombinators-Poly-StateLazy.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.7: 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>None</td></tr></table><p class="caption">Text.ParserCombinators.Poly.StateLazy</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The Parser datatype
</a><ul><li><a href="#g:2">Basic parsers
</a></li><li><a href="#g:3">State-handling
</a></li><li><a href="#g:4">Re-parsing
</a></li></ul></li><li><a href="#g:5">Re-export all more general combinators
</a></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">newtype</span>  <a href="#t:Parser">Parser</a> s t a = <a href="#v:P">P</a> (<a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a)</li><li class="src short"><span class="keyword">data</span>  <a href="#t:Result">Result</a> z a<ul class="subs"><li>= <a href="#v:Success">Success</a> z a  </li><li>| <a href="#v:Failure">Failure</a> z <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>  </li><li>| <a href="#v:Committed">Committed</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Result">Result</a> z a)  </li></ul></li><li class="src short"><a href="#v:runParser">runParser</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a -&gt; s -&gt; [t] -&gt; (a, s, [t])</li><li class="src short"><a href="#v:next">next</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t t</li><li class="src short"><a href="#v:eof">eof</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:satisfy">satisfy</a> ::  (t -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t t</li><li class="src short"><a href="#v:onFail">onFail</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 -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a</li><li class="src short"><a href="#v:manyFinally">manyFinally</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 z -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t [a]</li><li class="src short"><a href="#v:stUpdate">stUpdate</a> ::  (s -&gt; s) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:stQuery">stQuery</a> ::  (s -&gt; a) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a</li><li class="src short"><a href="#v:stGet">stGet</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t s</li><li class="src short"><a href="#v:reparse">reparse</a> ::  [t] -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short">module <a href="Text-ParserCombinators-Poly-Base.html">Text.ParserCombinators.Poly.Base</a></li><li class="src short">module <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Applicative.html">Control.Applicative</a></li></ul></div><div id="interface"><h1 id="g:1">The Parser datatype
</h1><div class="top"><p class="src"><span class="keyword">newtype</span>  <a name="t:Parser" class="def">Parser</a> s t a <a href="src/Text-ParserCombinators-Poly-StateLazy.html#Parser" class="link">Source</a></p><div class="doc"><p>The only differences between a State and a StateLazy parser are the
   instance of Applicative, and the type (and implementation) of runParser.
   We therefore need to <em>newtype</em> the original Parser type, to allow it
   to have a different instance.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:P" class="def">P</a> (<a href="Text-ParserCombinators-Poly-StateParser.html#t:Parser">Parser</a> s t a)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Parser" class="caption collapser" onclick="toggleSection('i:Parser')">Instances</p><div id="section.i:Parser" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Monad.html#t:Monad">Monad</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Monad.html#t:Functor">Functor</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Applicative.html#t:Alternative">Alternative</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-ParserCombinators-Poly-Base.html#t:PolyParse">PolyParse</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-ParserCombinators-Poly-Base.html#t:Commitment">Commitment</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Result" class="def">Result</a> z a <a href="src/Text-ParserCombinators-Poly-Result.html#Result" class="link">Source</a></p><div class="doc"><p>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.
   The z type is the remaining unconsumed input.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Success" class="def">Success</a> z a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:Failure" class="def">Failure</a> z <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:Committed" class="def">Committed</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Result">Result</a> z a)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Result" class="caption collapser" onclick="toggleSection('i:Result')">Instances</p><div id="section.i:Result" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Monad.html#t:Functor">Functor</a> (<a href="Text-ParserCombinators-Poly-StateLazy.html#t:Result">Result</a> z)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:runParser" class="def">runParser</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a -&gt; s -&gt; [t] -&gt; (a, s, [t])<a href="src/Text-ParserCombinators-Poly-StateLazy.html#runParser" class="link">Source</a></p><div class="doc"><p>Apply a parser to an input token sequence.
</p></div></div><h2 id="g:2">Basic parsers
</h2><div class="top"><p class="src"><a name="v:next" class="def">next</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t t<a href="src/Text-ParserCombinators-Poly-StateLazy.html#next" class="link">Source</a></p><div class="doc"><p>Simply return the next token in the input tokenstream.
</p></div></div><div class="top"><p class="src"><a name="v:eof" class="def">eof</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/Text-ParserCombinators-Poly-StateLazy.html#eof" class="link">Source</a></p><div class="doc"><p>Succeed if the end of file/input has been reached, fail otherwise.
</p></div></div><div class="top"><p class="src"><a name="v:satisfy" class="def">satisfy</a> ::  (t -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t t<a href="src/Text-ParserCombinators-Poly-StateLazy.html#satisfy" class="link">Source</a></p><div class="doc"><p>Return the next token if it satisfies the given predicate.
</p></div></div><div class="top"><p class="src"><a name="v:onFail" class="def">onFail</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 -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a<a href="src/Text-ParserCombinators-Poly-StateLazy.html#onFail" class="link">Source</a></p><div class="doc"><p><code>p <code><a href="Text-ParserCombinators-Poly-StateLazy.html#v:onFail">onFail</a></code> q</code> means parse p, unless p fails, in which case
   parse q instead.
   Can be chained together to give multiple attempts to parse something.
   (Note that q could itself be a failing parser, e.g. to change the error
   message from that defined in p to something different.)
   However, a severe failure in p cannot be ignored.
</p></div></div><div class="top"><p class="src"><a name="v:manyFinally" class="def">manyFinally</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 z -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t [a]<a href="src/Text-ParserCombinators-Poly-StateLazy.html#manyFinally" class="link">Source</a></p></div><h2 id="g:3">State-handling
</h2><div class="top"><p class="src"><a name="v:stUpdate" class="def">stUpdate</a> ::  (s -&gt; s) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/Text-ParserCombinators-Poly-StateLazy.html#stUpdate" class="link">Source</a></p><div class="doc"><p>Update the internal state.
</p></div></div><div class="top"><p class="src"><a name="v:stQuery" class="def">stQuery</a> ::  (s -&gt; a) -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t a<a href="src/Text-ParserCombinators-Poly-StateLazy.html#stQuery" class="link">Source</a></p><div class="doc"><p>Query the internal state.
</p></div></div><div class="top"><p class="src"><a name="v:stGet" class="def">stGet</a> ::  <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t s<a href="src/Text-ParserCombinators-Poly-StateLazy.html#stGet" class="link">Source</a></p><div class="doc"><p>Deliver the entire internal state.
</p></div></div><h2 id="g:4">Re-parsing
</h2><div class="top"><p class="src"><a name="v:reparse" class="def">reparse</a> ::  [t] -&gt; <a href="Text-ParserCombinators-Poly-StateLazy.html#t:Parser">Parser</a> s t <a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/Text-ParserCombinators-Poly-StateLazy.html#reparse" class="link">Source</a></p><div class="doc"><p>Push 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.
</p></div></div><h1 id="g:5">Re-export all more general combinators
</h1><div class="top"><p class="src">module <a href="Text-ParserCombinators-Poly-Base.html">Text.ParserCombinators.Poly.Base</a></p></div><div class="top"><p class="src">module <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.5.0.0/Control-Applicative.html">Control.Applicative</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.10.0</p></div></body></html>