<!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 >Ratified</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_Ratified.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" >Ratified</FONT ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></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%3AreadFile" >readFile</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-Char.html#t%3AString" >String</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AhGetContents" >hGetContents</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/GHC-IO-Handle.html#t%3AHandle" >Handle</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-Char.html#t%3AString" >String</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:readFile" ><A NAME="v%3AreadFile" ></A ></A ><B >readFile</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-Char.html#t%3AString" >String</A ></TD ></TR ><TR ><TD CLASS="doc" >The <TT ><A HREF="Ratified.html#v%3AreadFile" >readFile</A ></TT > function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#v%3AgetContents" >getContents</A ></TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:hGetContents" ><A NAME="v%3AhGetContents" ></A ></A ><B >hGetContents</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/GHC-IO-Handle.html#t%3AHandle" >Handle</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-Char.html#t%3AString" >String</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >Computation <TT ><A HREF="Ratified.html#v%3AhGetContents" >hGetContents</A ></TT > <TT >hdl</TT > returns the list of characters corresponding to the unread portion of the channel or file managed by <TT >hdl</TT >, which is put into an intermediate state, <EM >semi-closed</EM >. In this state, <TT >hdl</TT > is effectively closed, but items are read from <TT >hdl</TT > on demand and accumulated in a special list returned by <TT ><A HREF="Ratified.html#v%3AhGetContents" >hGetContents</A ></TT > <TT >hdl</TT >. </P ><P >Any operation that fails because a handle is closed, also fails if a handle is semi-closed. The only exception is hClose. A semi-closed handle becomes closed: </P ><UL ><LI > if hClose is applied to it; </LI ><LI > if an I/O error occurs when reading an item from the handle; </LI ><LI > or once the entire contents of the handle has been read. </LI ></UL ><P >Once a semi-closed handle becomes closed, the contents of the associated list becomes fixed. The contents of this final list is only partially specified: it will contain at least all the items of the stream that were evaluated prior to the handle becoming closed. </P ><P >Any I/O errors encountered while a handle is semi-closed are simply discarded. </P ><P >This operation may fail with: </P ><UL ><LI > <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO-Error.html#v%3AisEOFError" >isEOFError</A ></TT > if the end of file has been reached. </LI ></UL ></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 >