/usr/share/doc/libghc-text-doc/html/Data-Text-Lazy-Builder.html is in libghc-text-doc 1.2.2.2-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 | <!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>Data.Text.Lazy.Builder</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_Data-Text-Lazy-Builder.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Text-Lazy-Builder.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">text-1.2.2.2: An efficient packed Unicode text type.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) 2013 Bryan O'Sullivan<br />(c) 2010 Johan Tibell</td></tr><tr><th>License</th><td>BSD-style (see LICENSE)</td></tr><tr><th>Maintainer</th><td>Johan Tibell <johan.tibell@gmail.com></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>portable to Hugs and GHC</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Text.Lazy.Builder</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The Builder type</a></li><li><a href="#g:2">Constructing Builders</a></li><li><a href="#g:3">Flushing the buffer state</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Efficient construction of lazy <code>Text</code> values. The principal
operations on a <code>Builder</code> are <code>singleton</code>, <code>fromText</code>, and
<code>fromLazyText</code>, which construct new builders, and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#v:mappend">mappend</a></code>, which
concatenates two builders.</p><p>To get maximum performance when building lazy <code>Text</code> values using a
builder, associate <code>mappend</code> calls to the right. For example,
prefer</p><pre>singleton 'a' `mappend` (singleton 'b' `mappend` singleton 'c')</pre><p>to</p><pre>singleton 'a' `mappend` singleton 'b' `mappend` singleton 'c'</pre><p>as the latter associates <code>mappend</code> to the left. Or, equivalently,
prefer</p><pre>singleton 'a' <> singleton 'b' <> singleton 'c'</pre><p>since the <code><></code> from recent versions of <code><a href="Data.html#v:Monoid">Monoid</a></code> associates
to the right.</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">data</span> <a href="#t:Builder">Builder</a></li><li class="src short"><a href="#v:toLazyText">toLazyText</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy.html#t:Text">Text</a></li><li class="src short"><a href="#v:toLazyTextWith">toLazyTextWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy.html#t:Text">Text</a></li><li class="src short"><a href="#v:singleton">singleton</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromText">fromText</a> :: <a href="Data-Text.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromLazyText">fromLazyText</a> :: <a href="Data-Text-Lazy.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromString">fromString</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="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:flush">flush</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></li></ul></div><div id="interface"><h1 id="g:1">The Builder type</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Builder" class="def">Builder</a> <a href="src/Data-Text-Internal-Builder.html#Builder" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></p><div class="doc"><p>A <code>Builder</code> is an efficient way to build lazy <code>Text</code> values.
There are several functions for constructing builders, but only one
to inspect them: to extract any data, you have to turn them into
lazy <code>Text</code> values using <code>toLazyText</code>.</p><p>Internally, a builder constructs a lazy <code>Text</code> by filling arrays
piece by piece. As each buffer is filled, it is 'popped' off, to
become a new chunk of the resulting lazy <code>Text</code>. All this is
hidden from the user of the <code>Builder</code>.</p></div><div class="subs instances"><p id="control.i:Builder" class="caption collapser" onclick="toggleSection('i:Builder')">Instances</p><div id="section.i:Builder" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:Eq:1" class="instance expander" onclick="toggleSection('i:id:Builder:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-120" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:Ord:2" class="instance expander" onclick="toggleSection('i:id:Builder:Ord:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-123" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(<)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(<=)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(>)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(>=)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:Show:3" class="instance expander" onclick="toggleSection('i:id:Builder:Show:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-117" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:Show:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</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="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:IsString:4" class="instance expander" onclick="toggleSection('i:id:Builder:IsString:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:IsString">IsString</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-113" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:IsString:4" 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.1.0/Data-String.html#t:String">String</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:fromString" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:Semigroup:5" class="instance expander" onclick="toggleSection('i:id:Builder:Semigroup:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Semigroup.html#t:Semigroup">Semigroup</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-96" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:Semigroup:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-60--62-">(<>)</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:-60--62-" class="selflink">#</a></p><p class="src"><a href="#v:sconcat">sconcat</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-List-NonEmpty.html#t:NonEmpty">NonEmpty</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:sconcat" class="selflink">#</a></p><p class="src"><a href="#v:stimes">stimes</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integral">Integral</a> b => b -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:stimes" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Builder:Monoid:6" class="instance expander" onclick="toggleSection('i:id:Builder:Monoid:6')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></span> <a href="src/Data-Text-Internal-Builder.html#line-101" class="link">Source</a> <a href="#t:Builder" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Builder:Monoid:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mempty">mempty</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:mempty" class="selflink">#</a></p><p class="src"><a href="#v:mappend">mappend</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:mappend" class="selflink">#</a></p><p class="src"><a href="#v:mconcat">mconcat</a> :: [<a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a>] -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="#v:mconcat" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:toLazyText" class="def">toLazyText</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy.html#t:Text">Text</a> <a href="src/Data-Text-Internal-Builder.html#toLazyText" class="link">Source</a> <a href="#v:toLazyText" class="selflink">#</a></p><div class="doc"><p><em>O(n).</em> Extract a lazy <code>Text</code> from a <code>Builder</code> with a default
buffer size. The construction work takes place if and when the
relevant part of the lazy <code>Text</code> is demanded.</p></div></div><div class="top"><p class="src"><a id="v:toLazyTextWith" class="def">toLazyTextWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy.html#t:Text">Text</a> <a href="src/Data-Text-Internal-Builder.html#toLazyTextWith" class="link">Source</a> <a href="#v:toLazyTextWith" class="selflink">#</a></p><div class="doc"><p><em>O(n).</em> Extract a lazy <code>Text</code> from a <code>Builder</code>, using the given
size for the initial buffer. The construction work takes place if
and when the relevant part of the lazy <code>Text</code> is demanded.</p><p>If the initial buffer is too small to hold all data, subsequent
buffers will be the default buffer size.</p></div></div><h1 id="g:2">Constructing Builders</h1><div class="top"><p class="src"><a id="v:singleton" class="def">singleton</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="src/Data-Text-Internal-Builder.html#singleton" class="link">Source</a> <a href="#v:singleton" class="selflink">#</a></p><div class="doc"><p><em>O(1).</em> A <code>Builder</code> taking a single character, satisfying</p><ul><li><pre><code><a href="Data-Text-Lazy-Builder.html#v:toLazyText">toLazyText</a></code> (<code><a href="Data-Text-Lazy-Builder.html#v:singleton">singleton</a></code> c) = <code><a href="Data-Text-Lazy.html#v:singleton">singleton</a></code> c</pre></li></ul></div></div><div class="top"><p class="src"><a id="v:fromText" class="def">fromText</a> :: <a href="Data-Text.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="src/Data-Text-Internal-Builder.html#fromText" class="link">Source</a> <a href="#v:fromText" class="selflink">#</a></p><div class="doc"><p><em>O(1).</em> A <code>Builder</code> taking a <code><a href="Data-Text.html#t:Text">Text</a></code>, satisfying</p><ul><li><pre><code><a href="Data-Text-Lazy-Builder.html#v:toLazyText">toLazyText</a></code> (<code><a href="Data-Text-Lazy-Builder.html#v:fromText">fromText</a></code> t) = <code><a href="Data-Text-Lazy.html#v:fromChunks">fromChunks</a></code> [t]</pre></li></ul></div></div><div class="top"><p class="src"><a id="v:fromLazyText" class="def">fromLazyText</a> :: <a href="Data-Text-Lazy.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="src/Data-Text-Internal-Builder.html#fromLazyText" class="link">Source</a> <a href="#v:fromLazyText" class="selflink">#</a></p><div class="doc"><p><em>O(1).</em> A <code>Builder</code> taking a lazy <code>Text</code>, satisfying</p><ul><li><pre><code><a href="Data-Text-Lazy-Builder.html#v:toLazyText">toLazyText</a></code> (<code><a href="Data-Text-Lazy-Builder.html#v:fromLazyText">fromLazyText</a></code> t) = t</pre></li></ul></div></div><div class="top"><p class="src"><a id="v:fromString" class="def">fromString</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="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="src/Data-Text-Internal-Builder.html#fromString" class="link">Source</a> <a href="#v:fromString" class="selflink">#</a></p><div class="doc"><p><em>O(1).</em> A Builder taking a <code>String</code>, satisfying</p><ul><li><pre><code><a href="Data-Text-Lazy-Builder.html#v:toLazyText">toLazyText</a></code> (<code><a href="Data-Text-Lazy-Builder.html#v:fromString">fromString</a></code> s) = <code><a href="Data-Text-Lazy.html#v:fromChunks">fromChunks</a></code> [S.pack s]</pre></li></ul></div></div><h1 id="g:3">Flushing the buffer state</h1><div class="top"><p class="src"><a id="v:flush" class="def">flush</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> <a href="src/Data-Text-Internal-Builder.html#flush" class="link">Source</a> <a href="#v:flush" class="selflink">#</a></p><div class="doc"><p><em>O(1).</em> Pop the strict <code>Text</code> we have constructed so far, if any,
yielding a new chunk in the result lazy <code>Text</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>
|