Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > db7a4a658d190b3e658423135710c498 > files > 563

ghc-darcs-devel-2.8.3-1.fc18.i686.rpm

<!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>ByteStringUtils</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_ByteStringUtils.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/ByteStringUtils.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">darcs-2.8.3: a distributed, interactive, smart revision control system</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>droundy@abridgegame.org</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">ByteStringUtils</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>GZIp and MMap IO for ByteStrings, encoding utilities, and miscellaneous
 functions for Data.ByteString
</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"><a href="#v:unsafeWithInternals">unsafeWithInternals</a> ::  <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Foreign-Ptr.html#t:Ptr">Ptr</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Word.html#t:Word8">Word8</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:unpackPSFromUTF8">unpackPSFromUTF8</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:packStringToUTF8">packStringToUTF8</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:gzReadFilePS">gzReadFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:mmapFilePS">mmapFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:gzWriteFilePS">gzWriteFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:gzWriteFilePSs">gzWriteFilePSs</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:gzReadStdin">gzReadStdin</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:isGZFile">isGZFile</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a>)</li><li class="src short"><a href="#v:gzDecompress">gzDecompress</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; ([<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>], <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:dropSpace">dropSpace</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:breakSpace">breakSpace</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:linesPS">linesPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>]</li><li class="src short"><a href="#v:unlinesPS">unlinesPS</a> :: [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:hashPS">hashPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int32">Int32</a></li><li class="src short"><a href="#v:breakFirstPS">breakFirstPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:breakLastPS">breakLastPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:substrPS">substrPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:readIntPS">readIntPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:isFunky">isFunky</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:fromHex2PS">fromHex2PS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:fromPS2Hex">fromPS2Hex</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:betweenLinesPS">betweenLinesPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:breakAfterNthNewline">breakAfterNthNewline</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:breakBeforeNthNewline">breakBeforeNthNewline</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:intercalate">intercalate</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:isAscii">isAscii</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:decodeLocale">decodeLocale</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:encodeLocale">encodeLocale</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:decodeString">decodeString</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:unsafeWithInternals" class="def">unsafeWithInternals</a> ::  <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Foreign-Ptr.html#t:Ptr">Ptr</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Word.html#t:Word8">Word8</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> a) -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> a<a href="src/ByteStringUtils.html#unsafeWithInternals" class="link">Source</a></p><div class="doc"><p>Do something with the internals of a PackedString. Beware of
 altering the contents!
</p></div></div><div class="top"><p class="src"><a name="v:unpackPSFromUTF8" class="def">unpackPSFromUTF8</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/ByteStringUtils.html#unpackPSFromUTF8" class="link">Source</a></p><div class="doc"><p>Decodes a <code>ByteString</code> containing UTF-8 to a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></code>. Decoding errors are
   flagged with the U+FFFD character.
</p></div></div><div class="top"><p class="src"><a name="v:packStringToUTF8" class="def">packStringToUTF8</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#packStringToUTF8" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:gzReadFilePS" class="def">gzReadFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#gzReadFilePS" class="link">Source</a></p><div class="doc"><p>Read an entire file, which may or may not be gzip compressed, directly
 into a <code><a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:mmapFilePS" class="def">mmapFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#mmapFilePS" class="link">Source</a></p><div class="doc"><p>Like readFilePS, this reads an entire file directly into a
 <code><a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></code>, 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 <code>readFilePS</code>, the string representation in
 the file is assumed to be ISO-8859-1.
</p></div></div><div class="top"><p class="src"><a name="v:gzWriteFilePS" class="def">gzWriteFilePS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/ByteStringUtils.html#gzWriteFilePS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:gzWriteFilePSs" class="def">gzWriteFilePSs</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/ByteStringUtils.html#gzWriteFilePSs" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:gzReadStdin" class="def">gzReadStdin</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#gzReadStdin" class="link">Source</a></p><div class="doc"><p>Read standard input, which may or may not be gzip compressed, directly
 into a <code><a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:isGZFile" class="def">isGZFile</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a>)<a href="src/ByteStringUtils.html#isGZFile" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:gzDecompress" class="def">gzDecompress</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; ([<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>], <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a>)<a href="src/ByteStringUtils.html#gzDecompress" class="link">Source</a></p><div class="doc"><p>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).
</p></div></div><div class="top"><p class="src"><a name="v:dropSpace" class="def">dropSpace</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#dropSpace" class="link">Source</a></p><div class="doc"><p><code><a href="ByteStringUtils.html#v:dropSpace">dropSpace</a></code> efficiently returns the <code>ByteString</code> 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></div></div><div class="top"><p class="src"><a name="v:breakSpace" class="def">breakSpace</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#breakSpace" class="link">Source</a></p><div class="doc"><p><code><a href="ByteStringUtils.html#v:breakSpace">breakSpace</a></code> returns the pair of ByteStrings when the argument is
 broken at the first whitespace byte. I.e.
</p><pre> break isSpace == breakSpace
</pre></div></div><div class="top"><p class="src"><a name="v:linesPS" class="def">linesPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>]<a href="src/ByteStringUtils.html#linesPS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unlinesPS" class="def">unlinesPS</a> :: [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#unlinesPS" class="link">Source</a></p><div class="doc"><p>This function acts exactly like the <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Prelude.html">Prelude</a> unlines function, or like
<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString-Char8.html">Data.ByteString.Char8</a> <code><a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-List.html#v:unlines">unlines</a></code>, but with one important difference: it will
produce a string which may not end with a newline! That is:
</p><pre> unlinesPS [&quot;foo&quot;, &quot;bar&quot;]
</pre><p>evaluates to &quot;foo\nbar&quot;, not &quot;foo\nbar\n&quot;! This point should hold true for
<code><a href="ByteStringUtils.html#v:linesPS">linesPS</a></code> as well.
</p><p>TODO: rename this function. 
</p></div></div><div class="top"><p class="src"><a name="v:hashPS" class="def">hashPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int32">Int32</a><a href="src/ByteStringUtils.html#hashPS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:breakFirstPS" class="def">breakFirstPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#breakFirstPS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:breakLastPS" class="def">breakLastPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#breakLastPS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:substrPS" class="def">substrPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a><a href="src/ByteStringUtils.html#substrPS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:readIntPS" class="def">readIntPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#readIntPS" class="link">Source</a></p><div class="doc"><p>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.
</p></div></div><div class="top"><p class="src"><a name="v:isFunky" class="def">isFunky</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a><a href="src/ByteStringUtils.html#isFunky" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fromHex2PS" class="def">fromHex2PS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#fromHex2PS" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fromPS2Hex" class="def">fromPS2Hex</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#fromPS2Hex" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:betweenLinesPS" class="def">betweenLinesPS</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#betweenLinesPS" class="link">Source</a></p><div class="doc"><p>betweenLinesPS returns the B.ByteString between the two lines given,
 or Nothing if they do not appear.
</p></div></div><div class="top"><p class="src"><a name="v:breakAfterNthNewline" class="def">breakAfterNthNewline</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#breakAfterNthNewline" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:breakBeforeNthNewline" class="def">breakBeforeNthNewline</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>)<a href="src/ByteStringUtils.html#breakBeforeNthNewline" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:intercalate" class="def">intercalate</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></p><div class="doc"><p><em>O(n)</em> The <code><a href="ByteStringUtils.html#v:intercalate">intercalate</a></code> function takes a <code><a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></code> and a list of
 <code><a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s and concatenates the list after interspersing the first
 argument between each element of the list.
</p></div></div><div class="top"><p class="src"><a name="v:isAscii" class="def">isAscii</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</a><a href="src/ByteStringUtils.html#isAscii" class="link">Source</a></p><div class="doc"><p>Test if a ByteString is made of ascii characters
</p></div></div><div class="top"><p class="src"><a name="v:decodeLocale" class="def">decodeLocale</a> :: <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/ByteStringUtils.html#decodeLocale" class="link">Source</a></p><div class="doc"><p>Decode a ByteString to a String according to the current locale
 unsafePerformIO in the locale function is ratified by the fact that GHC 6.12
 and above also supply locale conversion with functions with a pure type.
 Unrecognized byte sequences in the input are skipped.
</p></div></div><div class="top"><p class="src"><a name="v:encodeLocale" class="def">encodeLocale</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/bytestring-0.9.2.1/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/ByteStringUtils.html#encodeLocale" class="link">Source</a></p><div class="doc"><p>Encode a String to a ByteString according to the current locale
</p></div></div><div class="top"><p class="src"><a name="v:decodeString" class="def">decodeString</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/ByteStringUtils.html#decodeString" class="link">Source</a></p><div class="doc"><p>Take a <code>String</code> that represents byte values and re-decode it acording to
 the current locale.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.10.0</p></div></body></html>