/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-ByteString.html is in libghc-blaze-builder-doc 0.4.0.2-3build2.
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 | <!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>Blaze.ByteString.Builder.ByteString</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_Blaze-ByteString-Builder-ByteString.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Blaze-ByteString-Builder-ByteString.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">blaze-builder-0.4.0.2: Efficient buffered output.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) 2013 Leon P Smith</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>Leon P Smith <leon@melding-monads.com></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Blaze.ByteString.Builder.ByteString</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Strict bytestrings</a></li><li><a href="#g:2">Lazy bytestrings</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p><code><a href="Blaze-ByteString-Builder-Internal-Write.html#t:Write">Write</a></code>s and <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code>s for strict and lazy bytestrings.</p><p>We assume the following qualified imports in order to differentiate between
strict and lazy bytestrings in the code examples.</p><pre>import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L</pre></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"><a href="#v:writeByteString">writeByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder-Internal-Write.html#t:Write">Write</a></li><li class="src short"><a href="#v:fromByteString">fromByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromByteStringWith">fromByteStringWith</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="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:copyByteString">copyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:insertByteString">insertByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromLazyByteString">fromLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:fromLazyByteStringWith">fromLazyByteStringWith</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="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:copyLazyByteString">copyLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:insertLazyByteString">insertLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></li></ul></div><div id="interface"><h1 id="g:1">Strict bytestrings</h1><div class="top"><p class="src"><a id="v:writeByteString" class="def">writeByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder-Internal-Write.html#t:Write">Write</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#writeByteString" class="link">Source</a> <a href="#v:writeByteString" class="selflink">#</a></p><div class="doc"><p>Write a strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> to a buffer.</p></div></div><div class="top"><p class="src"><a id="v:fromByteString" class="def">fromByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#fromByteString" class="link">Source</a> <a href="#v:fromByteString" class="selflink">#</a></p><div class="doc"><p>Create a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> denoting the same sequence of bytes as a strict
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>.
The <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> inserts large <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s directly, but copies small ones
to ensure that the generated chunks are large on average.</p></div></div><div class="top"><p class="src"><a id="v:fromByteStringWith" class="def">fromByteStringWith</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#fromByteStringWith" class="link">Source</a> <a href="#v:fromByteStringWith" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></td><td class="doc"><p>Maximal number of bytes to copy.</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>Strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> to serialize.</p></td></tr><tr><td class="src">-> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></td><td class="doc"><p>Resulting <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code>.</p></td></tr></table></div><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that copies the strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s, if it is
smaller than the treshold, and inserts it directly otherwise.</p><p>For example, <code>fromByteStringWith 1024</code> copies strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s whose size
is less or equal to 1kb, and inserts them directly otherwise. This implies
that the average chunk-size of the generated lazy <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></code> may be as
low as 513 bytes, as there could always be just a single byte between the
directly inserted 1025 byte, strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s.</p></div></div><div class="top"><p class="src"><a id="v:copyByteString" class="def">copyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#copyByteString" class="link">Source</a> <a href="#v:copyByteString" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that copies the strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>.</p><p>Use this function to create <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code>s from smallish (<code><= 4kb</code>)
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s or if you need to guarantee that the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> is not
shared with the chunks generated by the <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:insertByteString" class="def">insertByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#insertByteString" class="link">Source</a> <a href="#v:insertByteString" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that always inserts the strict <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>
directly as a chunk.</p><p>This implies flushing the output buffer, even if it contains just
a single byte. You should therefore use <code><a href="Blaze-ByteString-Builder-ByteString.html#v:insertByteString">insertByteString</a></code> only for large
(<code>> 8kb</code>) <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s. Otherwise, the generated chunks are too
fragmented to be processed efficiently afterwards.</p></div></div><h1 id="g:2">Lazy bytestrings</h1><div class="top"><p class="src"><a id="v:fromLazyByteString" class="def">fromLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#fromLazyByteString" class="link">Source</a> <a href="#v:fromLazyByteString" class="selflink">#</a></p><div class="doc"><p>Create a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> denoting the same sequence of bytes as a lazy
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>.
The <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> inserts large chunks of the lazy <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></code> directly,
but copies small ones to ensure that the generated chunks are large on
average.</p></div></div><div class="top"><p class="src"><a id="v:fromLazyByteStringWith" class="def">fromLazyByteStringWith</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="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#fromLazyByteStringWith" class="link">Source</a> <a href="#v:fromLazyByteStringWith" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that uses the thresholding strategy of <code><a href="Blaze-ByteString-Builder-ByteString.html#v:fromByteStringWith">fromByteStringWith</a></code>
for each chunk of the lazy <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:copyLazyByteString" class="def">copyLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#copyLazyByteString" class="link">Source</a> <a href="#v:copyLazyByteString" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that copies the lazy <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:insertLazyByteString" class="def">insertLazyByteString</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a> <a href="src/Blaze-ByteString-Builder-ByteString.html#insertLazyByteString" class="link">Source</a> <a href="#v:insertLazyByteString" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Blaze-ByteString-Builder.html#t:Builder">Builder</a></code> that inserts all chunks of the lazy <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></code>
directly.</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>
|