/usr/share/doc/libghc-boomerang-doc/html/Text-Boomerang-Strings.html is in libghc-boomerang-doc 1.4.5.2-3.
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 | <!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.Boomerang.Strings</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-Boomerang-Strings.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-Boomerang-Strings.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">boomerang-1.4.5.2: Library for invertible parsing and printing</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Text.Boomerang.Strings</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types</a></li><li><a href="#g:2">Combinators</a></li><li><a href="#g:3">Running the <code>Boomerang</code></a></li><li><a href="#section.orphans">Orphan instances</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>a <code><a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a></code> library for working with '[String]'</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:StringsError">StringsError</a> = <a href="Text-Boomerang-Error.html#t:ParserError">ParserError</a> <a href="Text-Boomerang-Pos.html#t:MajorMinorPos">MajorMinorPos</a></li><li class="src short"><a href="#v:-60--47--62-">(</>)</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] b c -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a b -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a c</li><li class="src short"><a href="#v:alpha">alpha</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:anyChar">anyChar</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:anyString">anyString</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:char">char</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:digit">digit</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:eos">eos</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r r</li><li class="src short"><a href="#v:int">int</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:integer">integer</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:lit">lit</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r r</li><li class="src short"><a href="#v:readshow">readshow</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a) => <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (a <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:satisfy">satisfy</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:satisfyStr">satisfyStr</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:space">space</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r)</li><li class="src short"><a href="#v:isComplete">isComplete</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:parseStrings">parseStrings</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] () (r <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> ()) -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> r</li><li class="src short"><a href="#v:unparseStrings">unparseStrings</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> e [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] () (r <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> ()) -> r -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>]</li></ul></div><div id="interface"><h1 id="g:1">Types</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:StringsError" class="def">StringsError</a> = <a href="Text-Boomerang-Error.html#t:ParserError">ParserError</a> <a href="Text-Boomerang-Pos.html#t:MajorMinorPos">MajorMinorPos</a> <a href="src/Text-Boomerang-Strings.html#StringsError" class="link">Source</a> <a href="#t:StringsError" class="selflink">#</a></p></div><h1 id="g:2">Combinators</h1><div class="top"><p class="src"><a id="v:-60--47--62-" class="def">(</>)</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] b c -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a b -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a c <span class="fixity">infixr 9</span><span class="rightedge"></span> <a href="src/Text-Boomerang-Strings.html#%3C%2F%3E" class="link">Source</a> <a href="#v:-60--47--62-" class="selflink">#</a></p><div class="doc"><p>equivalent to <code>f . eos . g</code></p></div></div><div class="top"><p class="src"><a id="v:alpha" class="def">alpha</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#alpha" class="link">Source</a> <a href="#v:alpha" class="selflink">#</a></p><div class="doc"><p>matches alphabetic Unicode characters (lower-case, upper-case and title-case letters,
plus letters of caseless scripts and modifiers letters). (Uses <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#v:isAlpha">isAlpha</a></code>)</p></div></div><div class="top"><p class="src"><a id="v:anyChar" class="def">anyChar</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#anyChar" class="link">Source</a> <a href="#v:anyChar" class="selflink">#</a></p><div class="doc"><p>any character</p></div></div><div class="top"><p class="src"><a id="v:anyString" class="def">anyString</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#anyString" class="link">Source</a> <a href="#v:anyString" class="selflink">#</a></p><div class="doc"><p>matches any <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></code></p><p>the parser returns the remainder of the current String segment, (but does not consume the 'end of segment'.</p><p>Note that the only combinator that should follow <code><a href="Text-Boomerang-Strings.html#v:anyString">anyString</a></code> is
<code><a href="Text-Boomerang-Strings.html#v:eos">eos</a></code> or <code><a href="Text-Boomerang-Strings.html#v:-60--47--62-"></></a></code>. Other combinators will lead to inconsistent
inversions.</p><p>For example, if we have:</p><pre>unparseStrings (rPair . anyString . anyString) ("foo","bar")</pre><p>That will unparse to <code>Just ["foobar"]</code>. But if we call</p><pre>parseStrings (rPair . anyString . anyString) ["foobar"]</pre><p>We will get <code>Right ("foobar","")</code> instead of the original <code>Right ("foo","bar")</code></p></div></div><div class="top"><p class="src"><a id="v:char" class="def">char</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#char" class="link">Source</a> <a href="#v:char" class="selflink">#</a></p><div class="doc"><p>matches the specified character</p></div></div><div class="top"><p class="src"><a id="v:digit" class="def">digit</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#digit" class="link">Source</a> <a href="#v:digit" class="selflink">#</a></p><div class="doc"><p>ascii digits <code>'0'..'9'</code></p></div></div><div class="top"><p class="src"><a id="v:eos" class="def">eos</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r r <a href="src/Text-Boomerang-Strings.html#eos" class="link">Source</a> <a href="#v:eos" class="selflink">#</a></p><div class="doc"><p>end of string</p></div></div><div class="top"><p class="src"><a id="v:int" class="def">int</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#int" class="link">Source</a> <a href="#v:int" class="selflink">#</a></p><div class="doc"><p>matches an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></code></p><p>Note that the combinator <code>(rPair . int . int)</code> is ill-defined because the parse can not tell where it is supposed to split the sequence of digits to produced two ints.</p></div></div><div class="top"><p class="src"><a id="v:integer" class="def">integer</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#integer" class="link">Source</a> <a href="#v:integer" class="selflink">#</a></p><div class="doc"><p>matches an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></code></p><p>Note that the combinator <code>(rPair . integer . integer)</code> is ill-defined because the parse can not tell where it is supposed to split the sequence of digits to produced two ints.</p></div></div><div class="top"><p class="src"><a id="v:lit" class="def">lit</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r r <a href="src/Text-Boomerang-Strings.html#lit" class="link">Source</a> <a href="#v:lit" class="selflink">#</a></p><div class="doc"><p>a constant string</p></div></div><div class="top"><p class="src"><a id="v:readshow" class="def">readshow</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a) => <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (a <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#readshow" class="link">Source</a> <a href="#v:readshow" class="selflink">#</a></p><div class="doc"><p>lift 'Read'/'Show' to a <code><a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a></code></p><p>There are a few restrictions here:</p><ol><li>Error messages are a bit fuzzy. <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a></code> does not tell us where
or why a parse failed. So all we can do it use the the position
that we were at when we called read and say that it failed.</li><li>it is (currently) not safe to use <code><a href="Text-Boomerang-Strings.html#v:readshow">readshow</a></code> on integral values
because the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a></code> instance for <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></code>, etc,</li></ol></div></div><div class="top"><p class="src"><a id="v:satisfy" class="def">satisfy</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#satisfy" class="link">Source</a> <a href="#v:satisfy" class="selflink">#</a></p><div class="doc"><p>statisfy a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></code> predicate</p></div></div><div class="top"><p class="src"><a id="v:satisfyStr" class="def">satisfyStr</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#satisfyStr" class="link">Source</a> <a href="#v:satisfyStr" class="selflink">#</a></p><div class="doc"><p>satisfy a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></code> predicate.</p><p>Note: must match the entire remainder of the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></code> in this segment</p></div></div><div class="top"><p class="src"><a id="v:space" class="def">space</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] r (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> r) <a href="src/Text-Boomerang-Strings.html#space" class="link">Source</a> <a href="#v:space" class="selflink">#</a></p><div class="doc"><p>matches white-space characters in the Latin-1 range. (Uses <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#v:isSpace">isSpace</a></code>)</p></div></div><h1 id="g:3">Running the <code><a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a></code></h1><div class="top"><p class="src"><a id="v:isComplete" class="def">isComplete</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Text-Boomerang-Strings.html#isComplete" class="link">Source</a> <a href="#v:isComplete" class="selflink">#</a></p><div class="doc"><p>Predicate to test if we have parsed all the strings.
Typically used as argument to <code><a href="Text-Boomerang-Prim.html#v:parse1">parse1</a></code></p><p>see also: <code><a href="Text-Boomerang-Strings.html#v:parseStrings">parseStrings</a></code></p></div></div><div class="top"><p class="src"><a id="v:parseStrings" class="def">parseStrings</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] () (r <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> ()) -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> r <a href="src/Text-Boomerang-Strings.html#parseStrings" class="link">Source</a> <a href="#v:parseStrings" class="selflink">#</a></p><div class="doc"><p>run the parser</p><p>Returns the first complete parse or a parse error.</p><pre>parseStrings (rUnit . lit "foo") ["foo"]</pre></div></div><div class="top"><p class="src"><a id="v:unparseStrings" class="def">unparseStrings</a> :: <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> e [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] () (r <a href="Text-Boomerang-HStack.html#t::-45-">:-</a> ()) -> r -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] <a href="src/Text-Boomerang-Strings.html#unparseStrings" class="link">Source</a> <a href="#v:unparseStrings" class="selflink">#</a></p><div class="doc"><p>run the printer</p><pre>unparseStrings (rUnit . lit "foo") ()</pre></div></div><h1>Orphan instances</h1><div id="section.orphans" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:InitialPosition:InitialPosition:1" class="instance expander" onclick="toggleSection('i:o:ic:InitialPosition:InitialPosition:1')"></span> <a href="Text-Boomerang-Pos.html#t:InitialPosition">InitialPosition</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a></span> <a href="src/Text-Boomerang-Strings.html#line-31" class="link">Source</a> <a href="#v:-36-fInitialPositionParserError" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:o:ic:InitialPosition:InitialPosition:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:initialPos">initialPos</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> -> <a href="Text-Boomerang-Pos.html#t:Pos">Pos</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> <a href="src/Text-Boomerang-Pos.html#initialPos" class="link">Source</a> <a href="#v:initialPos" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:IsString:IsString:2" class="instance expander" onclick="toggleSection('i:o:ic:IsString:IsString:2')"></span> (~) <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> a b => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:IsString">IsString</a> (<a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a b)</span> <a href="src/Text-Boomerang-Strings.html#line-34" class="link">Source</a> <a href="#v:-36-fIsStringBoomerang" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:o:ic:IsString:IsString:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fromString">fromString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="Text-Boomerang-Prim.html#t:Boomerang">Boomerang</a> <a href="Text-Boomerang-Strings.html#t:StringsError">StringsError</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] a b <a href="#v:fromString" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|