Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 1f2b142b9d2ef4849a6f5316fa1c5b12 > files > 1903

ghc-6.10.4-1mdv2010.0.i586.rpm

<!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
>FastString</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_FastString.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"
>ghc-6.10.4: The GHC API</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"
>FastString</FONT
></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"
>FastStrings
</A
></DT
><DD
><DL
><DT
><A HREF="#2"
>Construction
</A
></DT
><DT
><A HREF="#3"
>Deconstruction
</A
></DT
><DT
><A HREF="#4"
>Encoding
</A
></DT
><DT
><A HREF="#5"
>Operations
</A
></DT
><DT
><A HREF="#6"
>Outputing
</A
></DT
><DT
><A HREF="#7"
>Internal
</A
></DT
></DL
></DD
><DT
><A HREF="#8"
>LitStrings
</A
></DT
><DD
><DL
><DT
><A HREF="#9"
>Construction
</A
></DT
><DT
><A HREF="#10"
>Deconstruction
</A
></DT
><DT
><A HREF="#11"
>Operations
</A
></DT
></DL
></DD
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
><P
>There are two principal string types used internally by GHC:
</P
><P
><TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
>:
               * A compact, hash-consed, representation of character strings.
               * Comparison is O(1), and you can get a Unique.Unique from them.
               * Generated by <TT
><A HREF="FastString.html#v%3AfsLit"
>fsLit</A
></TT
>.
               * Turn into Outputable.SDoc with Outputable.ftext.
</P
><P
><TT
><A HREF="FastString.html#t%3ALitString"
>LitString</A
></TT
>:
               * Just a wrapper for the <TT
>Addr#</TT
> of a C string (<TT
>Ptr CChar</TT
>).
               * Practically no operations.
               * Outputing them is fast.
               * Generated by <TT
><A HREF="FastString.html#v%3AsLit"
>sLit</A
></TT
>.
               * Turn into Outputable.SDoc with Outputable.ptext
</P
><P
>Use <TT
><A HREF="FastString.html#t%3ALitString"
>LitString</A
></TT
> unless you want the facilities of <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
>.
</P
></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"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AFastString"
>FastString</A
>  = <A HREF="#v%3AFastString"
>FastString</A
> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="recfield"
><A HREF="#v%3Auniq"
>uniq</A
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3An_bytes"
>n_bytes</A
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3An_chars"
>n_chars</A
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3Abuf"
>buf</A
> :: !(<A HREF="../base/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>)</TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3Aenc"
>enc</A
> :: FSEncoding</TD
></TR
></TABLE
>}</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AfsLit"
>fsLit</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkFastString"
>mkFastString</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkFastStringBytes"
>mkFastStringBytes</A
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkFastStringByteList"
>mkFastStringByteList</A
> :: [<A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>] -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkFastStringForeignPtr"
>mkFastStringForeignPtr</A
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../base/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkFastString%23"
>mkFastString#</A
> :: <A HREF="../ghc-prim/GHC-Prim.html#t%3AAddr%23"
>Addr#</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkZFastString"
>mkZFastString</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkZFastStringBytes"
>mkZFastStringBytes</A
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunpackFS"
>unpackFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AbytesFS"
>bytesFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; [<A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisZEncoded"
>isZEncoded</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <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%3AzEncodeFS"
>zEncodeFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AuniqueOfFS"
>uniqueOfFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastTypes.html#t%3AFastInt"
>FastInt</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlengthFS"
>lengthFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <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%3AnullFS"
>nullFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <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%3AappendFS"
>appendFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AheadFS"
>headFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtailFS"
>tailFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AconcatFS"
>concatFS</A
> :: [<A HREF="FastString.html#t%3AFastString"
>FastString</A
>] -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AconsFS"
>consFS</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AnilFS"
>nilFS</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhPutFS"
>hPutFS</A
> :: <A HREF="../base/System-IO.html#t%3AHandle"
>Handle</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetFastStringTable"
>getFastStringTable</A
> :: <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> [[<A HREF="FastString.html#t%3AFastString"
>FastString</A
>]]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhasZEncoding"
>hasZEncoding</A
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A HREF="#t%3ALitString"
>LitString</A
> = <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsLit"
>sLit</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkLitString%23"
>mkLitString#</A
> :: <A HREF="../ghc-prim/GHC-Prim.html#t%3AAddr%23"
>Addr#</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmkLitString"
>mkLitString</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AunpackLitString"
>unpackLitString</A
> :: <A HREF="FastString.html#t%3ALitString"
>LitString</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlengthLS"
>lengthLS</A
> :: <A HREF="FastString.html#t%3ALitString"
>LitString</A
> -&gt; <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"
>FastStrings
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:FastString"
><A NAME="t%3AFastString"
></A
></A
><B
>FastString</B
>  </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>A <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> is an array of bytes, hashed to support fast O(1)
comparison.  It is also associated with a character encoding, so that
we know how to convert a <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> to the local encoding, or to the
Z-encoding used by the compiler internally.
</P
><P
><TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
>s support a memoized conversion to the Z-encoding via zEncodeFS.
</P
></TD
></TR
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:FastString"
><A NAME="v%3AFastString"
></A
></A
><B
>FastString</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="body" COLSPAN="2"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:uniq"
><A NAME="v%3Auniq"
></A
></A
><B
>uniq</B
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:n_bytes"
><A NAME="v%3An_bytes"
></A
></A
><B
>n_bytes</B
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:n_chars"
><A NAME="v%3An_chars"
></A
></A
><B
>n_chars</B
> :: !<A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:buf"
><A NAME="v%3Abuf"
></A
></A
><B
>buf</B
> :: !(<A HREF="../base/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>)</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:enc"
><A NAME="v%3Aenc"
></A
></A
><B
>enc</B
> :: FSEncoding</TD
><TD CLASS="rdoc"
></TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:FastString')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:FastString" 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="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base/Data-Ord.html#t%3AOrd"
>Ord</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Outputable.html#t%3AOutputable"
>Outputable</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Unique.html#t%3AUniquable"
>Uniquable</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Binary.html#t%3ABinary"
>Binary</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="2"
><A NAME="2"
>Construction
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:fsLit"
><A NAME="v%3AfsLit"
></A
></A
><B
>fsLit</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkFastString"
><A NAME="v%3AmkFastString"
></A
></A
><B
>mkFastString</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Creates a UTF-8 encoded <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> from a <TT
><A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TT
>
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkFastStringBytes"
><A NAME="v%3AmkFastStringBytes"
></A
></A
><B
>mkFastStringBytes</B
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkFastStringByteList"
><A NAME="v%3AmkFastStringByteList"
></A
></A
><B
>mkFastStringByteList</B
> :: [<A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>] -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Creates a <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> from a UTF-8 encoded <TT
>[Word8]</TT
>
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkFastStringForeignPtr"
><A NAME="v%3AmkFastStringForeignPtr"
></A
></A
><B
>mkFastStringForeignPtr</B
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../base/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Create a <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> from an existing <TT
><A HREF="../base/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
></TT
>; the difference
 between this and <TT
><A HREF="FastString.html#v%3AmkFastStringBytes"
>mkFastStringBytes</A
></TT
> is that we don't have to copy
 the bytes if the string is new to the table.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkFastString#"
><A NAME="v%3AmkFastString%23"
></A
></A
><B
>mkFastString#</B
> :: <A HREF="../ghc-prim/GHC-Prim.html#t%3AAddr%23"
>Addr#</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkZFastString"
><A NAME="v%3AmkZFastString"
></A
></A
><B
>mkZFastString</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Creates a Z-encoded <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> from a <TT
><A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TT
>
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkZFastStringBytes"
><A NAME="v%3AmkZFastStringBytes"
></A
></A
><B
>mkZFastStringBytes</B
> :: <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="3"
><A NAME="3"
>Deconstruction
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unpackFS"
><A NAME="v%3AunpackFS"
></A
></A
><B
>unpackFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="doc"
>Unpacks and decodes the FastString
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:bytesFS"
><A NAME="v%3AbytesFS"
></A
></A
><B
>bytesFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; [<A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
>]</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="4"
><A NAME="4"
>Encoding
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isZEncoded"
><A NAME="v%3AisZEncoded"
></A
></A
><B
>isZEncoded</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
>Returns <TT
>True</TT
> if the <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> is Z-encoded
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:zEncodeFS"
><A NAME="v%3AzEncodeFS"
></A
></A
><B
>zEncodeFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Returns a Z-encoded version of a <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
>.  This might be the
 original, if it was already Z-encoded.  The first time this
 function is applied to a particular <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
>, the results are
 memoized.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="5"
><A NAME="5"
>Operations
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:uniqueOfFS"
><A NAME="v%3AuniqueOfFS"
></A
></A
><B
>uniqueOfFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastTypes.html#t%3AFastInt"
>FastInt</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:lengthFS"
><A NAME="v%3AlengthFS"
></A
></A
><B
>lengthFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="doc"
>Returns the length of the <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> in characters
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:nullFS"
><A NAME="v%3AnullFS"
></A
></A
><B
>nullFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
>Returns <TT
>True</TT
> if the <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> is empty
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:appendFS"
><A NAME="v%3AappendFS"
></A
></A
><B
>appendFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:headFS"
><A NAME="v%3AheadFS"
></A
></A
><B
>headFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:tailFS"
><A NAME="v%3AtailFS"
></A
></A
><B
>tailFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:concatFS"
><A NAME="v%3AconcatFS"
></A
></A
><B
>concatFS</B
> :: [<A HREF="FastString.html#t%3AFastString"
>FastString</A
>] -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:consFS"
><A NAME="v%3AconsFS"
></A
></A
><B
>consFS</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:nilFS"
><A NAME="v%3AnilFS"
></A
></A
><B
>nilFS</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="6"
><A NAME="6"
>Outputing
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:hPutFS"
><A NAME="v%3AhPutFS"
></A
></A
><B
>hPutFS</B
> :: <A HREF="../base/System-IO.html#t%3AHandle"
>Handle</A
> -&gt; <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29"
>()</A
></TD
></TR
><TR
><TD CLASS="doc"
>Outputs a <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> with <EM
>no decoding at all</EM
>, that is, you
 get the actual bytes in the <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> written to the <TT
><A HREF="../base/System-IO.html#t%3AHandle"
>Handle</A
></TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="7"
><A NAME="7"
>Internal
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getFastStringTable"
><A NAME="v%3AgetFastStringTable"
></A
></A
><B
>getFastStringTable</B
> :: <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> [[<A HREF="FastString.html#t%3AFastString"
>FastString</A
>]]</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:hasZEncoding"
><A NAME="v%3AhasZEncoding"
></A
></A
><B
>hasZEncoding</B
> :: <A HREF="FastString.html#t%3AFastString"
>FastString</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
>Returns <TT
>True</TT
> if this <TT
><A HREF="FastString.html#t%3AFastString"
>FastString</A
></TT
> is not Z-encoded but already has
 a Z-encoding cached (used in producing stats).
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="8"
><A NAME="8"
>LitStrings
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>type</SPAN
> <A NAME="t:LitString"
><A NAME="t%3ALitString"
></A
></A
><B
>LitString</B
> = <A HREF="../base/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> <A HREF="../base/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="9"
><A NAME="9"
>Construction
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:sLit"
><A NAME="v%3AsLit"
></A
></A
><B
>sLit</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkLitString#"
><A NAME="v%3AmkLitString%23"
></A
></A
><B
>mkLitString#</B
> :: <A HREF="../ghc-prim/GHC-Prim.html#t%3AAddr%23"
>Addr#</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:mkLitString"
><A NAME="v%3AmkLitString"
></A
></A
><B
>mkLitString</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="FastString.html#t%3ALitString"
>LitString</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="10"
><A NAME="10"
>Deconstruction
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:unpackLitString"
><A NAME="v%3AunpackLitString"
></A
></A
><B
>unpackLitString</B
> :: <A HREF="FastString.html#t%3ALitString"
>LitString</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="11"
><A NAME="11"
>Operations
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:lengthLS"
><A NAME="v%3AlengthLS"
></A
></A
><B
>lengthLS</B
> :: <A HREF="FastString.html#t%3ALitString"
>LitString</A
> -&gt; <A HREF="../ghc-prim/GHC-Types.html#t%3AInt"
>Int</A
></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
>