<!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 >ByteStringUtils</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_ByteStringUtils.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" >darcs-2.4.4: a distributed, interactive, smart revision control system</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" >ByteStringUtils</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" >droundy@abridgegame.org</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" >GZIp and MMap IO for ByteStrings, and miscellaneous functions for Data.ByteString </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" ><A HREF="#v%3AunsafeWithInternals" >unsafeWithInternals</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Foreign-Ptr.html#t%3APtr" >Ptr</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8" >Word8</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > a) -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgzReadFilePS" >gzReadFilePS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AmmapFilePS" >mmapFilePS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgzWriteFilePS" >gzWriteFilePS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgzWriteFilePSs" >gzWriteFilePSs</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AisGZFile" >isGZFile</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgzDecompress" >gzDecompress</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString" >ByteString</A > -> ([<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >], <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Bool.html#t%3ABool" >Bool</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AifHeadThenTail" >ifHeadThenTail</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8" >Word8</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AdropSpace" >dropSpace</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AbreakSpace" >breakSpace</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AlinesPS" >linesPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >]</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AunlinesPS" >unlinesPS</A > :: [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AhashPS" >hashPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt32" >Int32</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AbreakFirstPS" >breakFirstPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AChar" >Char</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AbreakLastPS" >breakLastPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AChar" >Char</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsubstrPS" >substrPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AreadIntPS" >readIntPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Ais_funky" >is_funky</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfromHex2PS" >fromHex2PS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfromPS2Hex" >fromPS2Hex</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AbetweenLinesPS" >betweenLinesPS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Abreak_after_nth_newline" >break_after_nth_newline</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Abreak_before_nth_newline" >break_before_nth_newline</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Aintercalate" >intercalate</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:unsafeWithInternals" ><A NAME="v%3AunsafeWithInternals" ></A ></A ><B >unsafeWithInternals</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Foreign-Ptr.html#t%3APtr" >Ptr</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8" >Word8</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > a) -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > a</TD ></TR ><TR ><TD CLASS="doc" >Do something with the internals of a PackedString. Beware of altering the contents! </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:gzReadFilePS" ><A NAME="v%3AgzReadFilePS" ></A ></A ><B >gzReadFilePS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" >Read an entire file, which may or may not be gzip compressed, directly into a <TT ><A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:mmapFilePS" ><A NAME="v%3AmmapFilePS" ></A ></A ><B >mmapFilePS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" >Like readFilePS, this reads an entire file directly into a <TT ><A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TT >, but it is even more efficient. It involves directly mapping the file to memory. This has the advantage that the contents of the file never need to be copied. Also, under memory pressure the page may simply be discarded, wile in the case of readFilePS it would need to be written to swap. If you read many small files, mmapFilePS will be less memory-efficient than readFilePS, since each mmapFilePS takes up a separate page of memory. Also, you can run into bus errors if the file is modified. NOTE: as with readFilePS, the string representation in the file is assumed to be ISO-8859-1. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:gzWriteFilePS" ><A NAME="v%3AgzWriteFilePS" ></A ></A ><B >gzWriteFilePS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:gzWriteFilePSs" ><A NAME="v%3AgzWriteFilePSs" ></A ></A ><B >gzWriteFilePSs</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:isGZFile" ><A NAME="v%3AisGZFile" ></A ></A ><B >isGZFile</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A >)</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:gzDecompress" ><A NAME="v%3AgzDecompress" ></A ></A ><B >gzDecompress</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString" >ByteString</A > -> ([<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >], <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Bool.html#t%3ABool" >Bool</A >)</TD ></TR ><TR ><TD CLASS="doc" >Decompress the given bytestring into a lazy list of chunks, along with a boolean flag indicating (if True) that the CRC was corrupted. Inspecting the flag will cause the entire list of chunks to be evaluated (but if you throw away the list immediately this should run in constant space). </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:ifHeadThenTail" ><A NAME="v%3AifHeadThenTail" ></A ></A ><B >ifHeadThenTail</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8" >Word8</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:dropSpace" ><A NAME="v%3AdropSpace" ></A ></A ><B >dropSpace</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><A HREF="ByteStringUtils.html#v%3AdropSpace" >dropSpace</A ></TT > efficiently returns the ByteString argument with white space Chars removed from the front. It is more efficient than calling dropWhile for removing whitespace. I.e. </P ><PRE > dropWhile isSpace == dropSpace </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:breakSpace" ><A NAME="v%3AbreakSpace" ></A ></A ><B >breakSpace</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><A HREF="ByteStringUtils.html#v%3AbreakSpace" >breakSpace</A ></TT > returns the pair of ByteStrings when the argument is broken at the first whitespace byte. I.e. </P ><PRE > break isSpace == breakSpace </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:linesPS" ><A NAME="v%3AlinesPS" ></A ></A ><B >linesPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >]</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:unlinesPS" ><A NAME="v%3AunlinesPS" ></A ></A ><B >unlinesPS</B > :: [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >This function acts exactly like the <A HREF="Prelude.html" >Prelude</A > unlines function, or like <A HREF="Data-ByteString-Char8.html" >Data.ByteString.Char8</A > <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-List.html#v%3Aunlines" >unlines</A ></TT >, but with one important difference: it will produce a string which may not end with a newline! That is: </P ><PRE > unlinesPS ["foo", "bar"] </PRE ><P >evaluates to "foo\nbar", not "foo\nbar\n"! This point should hold true for <TT ><A HREF="ByteStringUtils.html#v%3AlinesPS" >linesPS</A ></TT > as well. </P ><P >TODO: rename this function. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:hashPS" ><A NAME="v%3AhashPS" ></A ></A ><B >hashPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt32" >Int32</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:breakFirstPS" ><A NAME="v%3AbreakFirstPS" ></A ></A ><B >breakFirstPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AChar" >Char</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:breakLastPS" ><A NAME="v%3AbreakLastPS" ></A ></A ><B >breakLastPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AChar" >Char</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:substrPS" ><A NAME="v%3AsubstrPS" ></A ></A ><B >substrPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:readIntPS" ><A NAME="v%3AreadIntPS" ></A ></A ><B >readIntPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="doc" >readIntPS skips any whitespace at the beginning of its argument, and reads an Int from the beginning of the PackedString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, along with a B.ByteString containing the remainder of its input. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:is_funky" ><A NAME="v%3Ais_funky" ></A ></A ><B >is_funky</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:fromHex2PS" ><A NAME="v%3AfromHex2PS" ></A ></A ><B >fromHex2PS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:fromPS2Hex" ><A NAME="v%3AfromPS2Hex" ></A ></A ><B >fromPS2Hex</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:betweenLinesPS" ><A NAME="v%3AbetweenLinesPS" ></A ></A ><B >betweenLinesPS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" >betweenLinesPS returns the B.ByteString between the two lines given, or Nothing if they do not appear. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:break_after_nth_newline" ><A NAME="v%3Abreak_after_nth_newline" ></A ></A ><B >break_after_nth_newline</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe" >Maybe</A > (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:break_before_nth_newline" ><A NAME="v%3Abreak_before_nth_newline" ></A ></A ><B >break_before_nth_newline</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >, <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >)</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:intercalate" ><A NAME="v%3Aintercalate" ></A ></A ><B >intercalate</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A > -> [<A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A >] -> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TD ></TR ><TR ><TD CLASS="doc" ><EM >O(n)</EM > The <TT ><A HREF="ByteStringUtils.html#v%3Aintercalate" >intercalate</A ></TT > function takes a <TT ><A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TT > and a list of <TT ><A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString.html#t%3AByteString" >ByteString</A ></TT >s and concatenates the list after interspersing the first argument between each element of the list. </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.6.0</TD ></TR ></TABLE ></BODY ></HTML >