Files
dotfiles/cabal/share/doc/x86_64-osx-ghc-7.10.1/MissingH-1.3.0.1/html/Text-ParserCombinators-Parsec-Utils.html
2015-04-05 17:47:08 +02:00

10 lines
9.8 KiB
HTML

<!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.Parsec.Utils</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-Parsec-Utils.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">MissingH-1.3.0.1: Large utility library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2004-2011 John Goerzen</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen &lt;jgoerzen@complete.org&gt; </td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Text.ParserCombinators.Parsec.Utils</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Generalized Utilities</a></li><li><a href="#g:2">Other Utilities</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Written by John Goerzen, jgoerzen@complete.org</p></div></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">type</span> <a href="#t:GeneralizedToken">GeneralizedToken</a> a = (SourcePos, a)</li><li class="src short"><span class="keyword">type</span> <a href="#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st b = GenParser (<a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a> a) st b</li><li class="src short"><a href="#v:togtok">togtok</a> :: a -&gt; GenParser b st (<a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a> a)</li><li class="src short"><a href="#v:tokeng">tokeng</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; (a -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st b</li><li class="src short"><a href="#v:satisfyg">satisfyg</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; (a -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</li><li class="src short"><a href="#v:oneOfg">oneOfg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; [a] -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</li><li class="src short"><a href="#v:noneOfg">noneOfg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; [a] -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</li><li class="src short"><a href="#v:specificg">specificg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; a -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</li><li class="src short"><a href="#v:allg">allg</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st [a]</li><li class="src short"><a href="#v:notMatching">notMatching</a> :: GenParser a b c -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -&gt; GenParser a b ()</li></ul></div><div id="interface"><h1 id="g:1">Generalized Utilities</h1><div class="doc"><p>These functions are generalized versions of
ones you might see in the Char parser.</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:GeneralizedToken" class="def">GeneralizedToken</a> a = (SourcePos, a)</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:GeneralizedTokenParser" class="def">GeneralizedTokenParser</a> a st b = GenParser (<a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a> a) st b</p></div><div class="top"><p class="src"><a name="v:togtok" class="def">togtok</a> :: a -&gt; GenParser b st (<a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a> a)</p><div class="doc"><p>Generate (return) a <code><a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:tokeng" class="def">tokeng</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; (a -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Maybe.html#t:Maybe">Maybe</a> b) -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st b</p><div class="doc"><p>Retrieve the next token from a <code><a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedToken">GeneralizedToken</a></code> stream.
The given function should return the value to use, or Nothing
to cause an error. </p></div></div><div class="top"><p class="src"><a name="v:satisfyg" class="def">satisfyg</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; (a -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</p><div class="doc"><p>A shortcut to <code><a href="Text-ParserCombinators-Parsec-Utils.html#v:tokeng">tokeng</a></code>; the test here is just a function that returns
a Bool. If the result is true; return that value -- otherwise, an error.</p></div></div><div class="top"><p class="src"><a name="v:oneOfg" class="def">oneOfg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; [a] -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</p><div class="doc"><p>Matches one item in a list and returns it. </p></div></div><div class="top"><p class="src"><a name="v:noneOfg" class="def">noneOfg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; [a] -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</p><div class="doc"><p>Matches one item not in a list and returns it. </p></div></div><div class="top"><p class="src"><a name="v:specificg" class="def">specificg</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a) =&gt; a -&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st a</p><div class="doc"><p>Matches one specific token and returns it. </p></div></div><div class="top"><p class="src"><a name="v:allg" class="def">allg</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a =&gt; <a href="Text-ParserCombinators-Parsec-Utils.html#t:GeneralizedTokenParser">GeneralizedTokenParser</a> a st [a]</p><div class="doc"><p>Matches all items and returns them </p></div></div><h1 id="g:2">Other Utilities</h1><div class="top"><p class="src"><a name="v:notMatching" class="def">notMatching</a> :: GenParser a b c -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -&gt; GenParser a b ()</p><div class="doc"><p>Running <code>notMatching p msg</code> will try to apply parser p.
If it fails, returns (). If it succeds, cause a failure and raise
the given error message. It will not consume input in either case. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.0</p></div></body></html>