/usr/share/doc/libghc-text-doc/html/Data-Text-Lazy-Builder.html is in libghc-text-doc 0.11.3.1-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 42 43 | <!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 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-0.11.3.1: An efficient packed Unicode text type.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable to Hugs and GHC</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>Johan Tibell <johan.tibell@gmail.com></td></tr><tr><th>Safe Haskell</th><td>None</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>mappend</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.
</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-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:toLazyTextWith">toLazyTextWith</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:singleton">singleton</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/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-Internal.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-Internal.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="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/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 name="t:Builder" class="def">Builder</a> <a href="src/Data-Text-Lazy-Builder-Internal.html#Builder" class="link">Source</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"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:IsString">IsString</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:toLazyText" class="def">toLazyText</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Internal.html#t:Text">Text</a><a href="src/Data-Text-Lazy-Builder-Internal.html#toLazyText" class="link">Source</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 name="v:toLazyTextWith" class="def">toLazyTextWith</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a> -> <a href="Data-Text-Lazy-Internal.html#t:Text">Text</a><a href="src/Data-Text-Lazy-Builder-Internal.html#toLazyTextWith" class="link">Source</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 name="v:singleton" class="def">singleton</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a><a href="src/Data-Text-Lazy-Builder-Internal.html#singleton" class="link">Source</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 name="v:fromText" class="def">fromText</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a><a href="src/Data-Text-Lazy-Builder-Internal.html#fromText" class="link">Source</a></p><div class="doc"><p><em>O(1).</em> A <code>Builder</code> taking a <code><a href="Data-Text-Internal.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 name="v:fromLazyText" class="def">fromLazyText</a> :: <a href="Data-Text-Lazy-Internal.html#t:Text">Text</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a><a href="src/Data-Text-Lazy-Builder-Internal.html#fromLazyText" class="link">Source</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 name="v:fromString" class="def">fromString</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a><a href="src/Data-Text-Lazy-Builder-Internal.html#fromString" class="link">Source</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 name="v:flush" class="def">flush</a> :: <a href="Data-Text-Lazy-Builder.html#t:Builder">Builder</a><a href="src/Data-Text-Lazy-Builder-Internal.html#flush" class="link">Source</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.13.2</p></div></body></html>
|