<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >Data.ByteString.Lazy.Internal</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_Data-ByteString-Lazy-Internal.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >bytestring-0.9.1.4: Fast, packed, strict and lazy byte arrays with a list interface</TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >Data.ByteString.Lazy.Internal</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >portable</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >experimental</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >dons@galois.com, duncan@haskell.org</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" ><B >Contents</B ></TD ></TR ><TR ><TD ><DL ><DT ><A HREF="#1" >The lazy <TT >ByteString</TT > type and representation </A ></DT ><DT ><A HREF="#2" >Data type invariant and abstraction function </A ></DT ><DT ><A HREF="#3" >Chunk allocation sizes </A ></DT ></DL ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" >A module containing semi-public <TT ><A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TT > internals. This exposes the <TT ><A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TT > representation and low level construction functions. Modules which extend the <TT ><A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TT > system will need to use this module while ideally most users will be able to make do with the public interface modules. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AByteString" >ByteString</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3AEmpty" >Empty</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AChunk" >Chunk</A > !<A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Achunk" >chunk</A > :: <A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfoldrChunks" >foldrChunks</A > :: (<A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> a -> a) -> a -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfoldlChunks" >foldlChunks</A > :: (a -> <A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> a) -> a -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Ainvariant" >invariant</A > :: <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcheckInvariant" >checkInvariant</A > :: <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AdefaultChunkSize" >defaultChunkSize</A > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsmallChunkSize" >smallChunkSize</A > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AchunkOverhead" >chunkOverhead</A > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="1" ><A NAME="1" >The lazy <TT >ByteString</TT > type and representation </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:ByteString" ><A NAME="t%3AByteString" ></A ></A ><B >ByteString</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" ><P >A space-efficient representation of a Word8 vector, supporting many efficient operations. A <TT ><A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TT > contains 8-bit characters only. </P ><P >Instances of Eq, Ord, Read, Show, Data, Typeable </P ></TD ></TR ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:Empty" ><A NAME="v%3AEmpty" ></A ></A ><B >Empty</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Chunk" ><A NAME="v%3AChunk" ></A ></A ><B >Chunk</B > !<A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:ByteString')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:ByteString" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Eq.html#t%3AEq" >Eq</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Data.html#t%3AData" >Data</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Ord.html#t%3AOrd" >Ord</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Text-Read.html#t%3ARead" >Read</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Text-Show.html#t%3AShow" >Show</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Typeable.html#t%3ATypeable" >Typeable</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-String.html#t%3AIsString" >IsString</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Monoid.html#t%3AMonoid" >Monoid</A > <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:chunk" ><A NAME="v%3Achunk" ></A ></A ><B >chunk</B > :: <A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" >Smart constructor for <TT ><A HREF="Data-ByteString-Lazy-Internal.html#v%3AChunk" >Chunk</A ></TT >. Guarantees the data type invariant. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:foldrChunks" ><A NAME="v%3AfoldrChunks" ></A ></A ><B >foldrChunks</B > :: (<A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> a -> a) -> a -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> a</TD ></TR ><TR ><TD CLASS="doc" >Consume the chunks of a lazy ByteString with a natural right fold. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:foldlChunks" ><A NAME="v%3AfoldlChunks" ></A ></A ><B >foldlChunks</B > :: (a -> <A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A > -> a) -> a -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> a</TD ></TR ><TR ><TD CLASS="doc" >Consume the chunks of a lazy ByteString with a strict, tail-recursive, accumulating left fold. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="2" ><A NAME="2" >Data type invariant and abstraction function </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:invariant" ><A NAME="v%3Ainvariant" ></A ></A ><B >invariant</B > :: <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="doc" >The data type invariant: Every ByteString is either <TT ><A HREF="Data-ByteString-Lazy-Internal.html#v%3AEmpty" >Empty</A ></TT > or consists of non-null <TT ><A HREF="Data-ByteString-Internal.html#t%3AByteString" >ByteString</A ></TT >s. All functions must preserve this, and the QC properties must check this. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:checkInvariant" ><A NAME="v%3AcheckInvariant" ></A ></A ><B >checkInvariant</B > :: <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A > -> <A HREF="Data-ByteString-Lazy-Internal.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" >In a form that checks the invariant lazily. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="3" ><A NAME="3" >Chunk allocation sizes </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:defaultChunkSize" ><A NAME="v%3AdefaultChunkSize" ></A ></A ><B >defaultChunkSize</B > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="doc" >Currently set to 32k, less the memory management overhead </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:smallChunkSize" ><A NAME="v%3AsmallChunkSize" ></A ></A ><B >smallChunkSize</B > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="doc" >Currently set to 4k, less the memory management overhead </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:chunkOverhead" ><A NAME="v%3AchunkOverhead" ></A ></A ><B >chunkOverhead</B > :: <A HREF="../ghc-prim/GHC-Types.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="doc" >The memory management overhead. Currently this is tuned for GHC only. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.4.2</TD ></TR ></TABLE ></BODY ></HTML >