Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > ced6c87363f828494726b6b2035d675f > files > 3

ghc-binary-doc-0.5.0.2-1.fc13.i686.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
>Data.Binary.Get</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_Data-Binary-Get.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"
>binary-0.5.0.2: Binary serialisation for Haskell values using lazy ByteStrings</TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Data.Binary.Get</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Portability</TD
><TD CLASS="infoval"
>portable to Hugs and GHC.</TD
></TR
><TR
><TD CLASS="infohead"
>Stability</TD
><TD CLASS="infoval"
>experimental</TD
></TR
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>Lennart Kolmodin &lt;kolmodin@dtek.chalmers.se&gt;</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>The Get type
</A
></DT
><DT
><A HREF="#2"
>Parsing
</A
></DT
><DT
><A HREF="#3"
>Utility
</A
></DT
><DT
><A HREF="#4"
>Parsing particular types
</A
></DT
><DD
><DL
><DT
><A HREF="#5"
>ByteStrings
</A
></DT
><DT
><A HREF="#6"
>Big-endian reads
</A
></DT
><DT
><A HREF="#7"
>Little-endian reads
</A
></DT
><DT
><A HREF="#8"
>Host-endian, unaligned reads
</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"
>The Get monad. A monad for efficiently building structures from
 encoded lazy ByteStrings
</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%3AGet"
>Get</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ArunGet"
>runGet</A
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
> -&gt; a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ArunGetState"
>runGetState</A
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; (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/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Askip"
>skip</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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%3AuncheckedSkip"
>uncheckedSkip</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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%3AlookAhead"
>lookAhead</A
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlookAheadM"
>lookAheadM</A
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> a) -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> a)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AlookAheadE"
>lookAheadE</A
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither"
>Either</A
> a b) -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither"
>Either</A
> a b)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AuncheckedLookAhead"
>uncheckedLookAhead</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AbytesRead"
>bytesRead</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetBytes"
>getBytes</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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%3Aremaining"
>remaining</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisEmpty"
>isEmpty</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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%3AgetWord8"
>getWord8</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetByteString"
>getByteString</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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%3AgetLazyByteString"
>getLazyByteString</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetLazyByteStringNul"
>getLazyByteStringNul</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetRemainingLazyByteString"
>getRemainingLazyByteString</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord16be"
>getWord16be</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord32be"
>getWord32be</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord64be"
>getWord64be</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord16le"
>getWord16le</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord32le"
>getWord32le</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord64le"
>getWord64le</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWordhost"
>getWordhost</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord"
>Word</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord16host"
>getWord16host</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord32host"
>getWord32host</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetWord64host"
>getWord64host</A
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
><A NAME="1"
>The Get type
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Get"
><A NAME="t%3AGet"
></A
></A
><B
>Get</B
> a </TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>The Get monad is just a State monad carrying around the input ByteString
 We treat it as a strict state monad. 
</TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Get')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Get" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Monad.html#t%3AMonad"
>Monad</A
> <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Monad.html#t%3AFunctor"
>Functor</A
> <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Monad-Fix.html#t%3AMonadFix"
>MonadFix</A
> <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Applicative.html#t%3AApplicative"
>Applicative</A
> <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:runGet"
><A NAME="v%3ArunGet"
></A
></A
><B
>runGet</B
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
> -&gt; a</TD
></TR
><TR
><TD CLASS="doc"
>Run the Get monad applies a <TT
>get</TT
>-based parser on the input ByteString
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:runGetState"
><A NAME="v%3ArunGetState"
></A
></A
><B
>runGetState</B
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; (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/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
>)</TD
></TR
><TR
><TD CLASS="doc"
>Run the Get monad applies a <TT
>get</TT
>-based parser on the input
 ByteString. Additional to the result of get it returns the number of
 consumed bytes and the rest of the input.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="2"
><A NAME="2"
>Parsing
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:skip"
><A NAME="v%3Askip"
></A
></A
><B
>skip</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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="doc"
>Skip ahead <TT
>n</TT
> bytes. Fails if fewer than <TT
>n</TT
> bytes are available.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:uncheckedSkip"
><A NAME="v%3AuncheckedSkip"
></A
></A
><B
>uncheckedSkip</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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="doc"
>Skip ahead <TT
>n</TT
> bytes. No error if there isn't enough bytes.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:lookAhead"
><A NAME="v%3AlookAhead"
></A
></A
><B
>lookAhead</B
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> a</TD
></TR
><TR
><TD CLASS="doc"
>Run <TT
>ga</TT
>, but return without consuming its input.
 Fails if <TT
>ga</TT
> fails.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:lookAheadM"
><A NAME="v%3AlookAheadM"
></A
></A
><B
>lookAheadM</B
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> a) -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> a)</TD
></TR
><TR
><TD CLASS="doc"
>Like <TT
><A HREF="Data-Binary-Get.html#v%3AlookAhead"
>lookAhead</A
></TT
>, but consume the input if <TT
>gma</TT
> returns 'Just _'.
 Fails if <TT
>gma</TT
> fails.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:lookAheadE"
><A NAME="v%3AlookAheadE"
></A
></A
><B
>lookAheadE</B
> ::  <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither"
>Either</A
> a b) -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither"
>Either</A
> a b)</TD
></TR
><TR
><TD CLASS="doc"
>Like <TT
><A HREF="Data-Binary-Get.html#v%3AlookAhead"
>lookAhead</A
></TT
>, but consume the input if <TT
>gea</TT
> returns 'Right _'.
 Fails if <TT
>gea</TT
> fails.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:uncheckedLookAhead"
><A NAME="v%3AuncheckedLookAhead"
></A
></A
><B
>uncheckedLookAhead</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Get the next up to <TT
>n</TT
> bytes as a lazy ByteString, without consuming them. 
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="3"
><A NAME="3"
>Utility
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:bytesRead"
><A NAME="v%3AbytesRead"
></A
></A
><B
>bytesRead</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="doc"
>Get the total number of bytes read to this point.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getBytes"
><A NAME="v%3AgetBytes"
></A
></A
><B
>getBytes</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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
>Pull <TT
>n</TT
> bytes from the input, as a strict ByteString.
</P
><P
>important
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:remaining"
><A NAME="v%3Aremaining"
></A
></A
><B
>remaining</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="doc"
>Get the number of remaining unparsed bytes.
 Useful for checking whether all input has been consumed.
 Note that this forces the rest of the input.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isEmpty"
><A NAME="v%3AisEmpty"
></A
></A
><B
>isEmpty</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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"
>Test whether all input has been consumed,
 i.e. there are no remaining unparsed bytes.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="4"
><A NAME="4"
>Parsing particular types
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord8"
><A NAME="v%3AgetWord8"
></A
></A
><B
>getWord8</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word8 from the monad state
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="5"
><A NAME="5"
>ByteStrings
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getByteString"
><A NAME="v%3AgetByteString"
></A
></A
><B
>getByteString</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</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"
>An efficient <TT
>get</TT
> method for strict ByteStrings. Fails if fewer
 than <TT
>n</TT
> bytes are left in the input.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getLazyByteString"
><A NAME="v%3AgetLazyByteString"
></A
></A
><B
>getLazyByteString</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Int.html#t%3AInt64"
>Int64</A
> -&gt; <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="doc"
>An efficient <TT
>get</TT
> method for lazy ByteStrings. Does not fail if fewer than
 <TT
>n</TT
> bytes are left in the input.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getLazyByteStringNul"
><A NAME="v%3AgetLazyByteStringNul"
></A
></A
><B
>getLazyByteStringNul</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Get a lazy ByteString that is terminated with a NUL byte. Fails
 if it reaches the end of input without hitting a NUL.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getRemainingLazyByteString"
><A NAME="v%3AgetRemainingLazyByteString"
></A
></A
><B
>getRemainingLazyByteString</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/bytestring-0.9.1.5/Data-ByteString-Lazy.html#t%3AByteString"
>ByteString</A
></TD
></TR
><TR
><TD CLASS="doc"
>Get the remaining bytes as a lazy ByteString
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="6"
><A NAME="6"
>Big-endian reads
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord16be"
><A NAME="v%3AgetWord16be"
></A
></A
><B
>getWord16be</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word16 in big endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord32be"
><A NAME="v%3AgetWord32be"
></A
></A
><B
>getWord32be</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word32 in big endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord64be"
><A NAME="v%3AgetWord64be"
></A
></A
><B
>getWord64be</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word64 in big endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="7"
><A NAME="7"
>Little-endian reads
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord16le"
><A NAME="v%3AgetWord16le"
></A
></A
><B
>getWord16le</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word16 in little endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord32le"
><A NAME="v%3AgetWord32le"
></A
></A
><B
>getWord32le</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word32 in little endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord64le"
><A NAME="v%3AgetWord64le"
></A
></A
><B
>getWord64le</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="doc"
>Read a Word64 in little endian format
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="8"
><A NAME="8"
>Host-endian, unaligned reads
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWordhost"
><A NAME="v%3AgetWordhost"
></A
></A
><B
>getWordhost</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord"
>Word</A
></TD
></TR
><TR
><TD CLASS="doc"
><EM
>O(1).</EM
> Read a single native machine word. The word is read in
 host order, host endian form, for the machine you're on. On a 64 bit
 machine the Word is an 8 byte value, on a 32 bit machine, 4 bytes.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord16host"
><A NAME="v%3AgetWord16host"
></A
></A
><B
>getWord16host</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="doc"
><EM
>O(1).</EM
> Read a 2 byte Word16 in native host order and host endianness.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord32host"
><A NAME="v%3AgetWord32host"
></A
></A
><B
>getWord32host</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="doc"
><EM
>O(1).</EM
> Read a Word32 in native host order and host endianness.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getWord64host"
><A NAME="v%3AgetWord64host"
></A
></A
><B
>getWord64host</B
> :: <A HREF="Data-Binary-Get.html#t%3AGet"
>Get</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="doc"
><EM
>O(1).</EM
> Read a Word64 in native host order and host endianess.
</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
>