<!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 >Darcs.Hopefully</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_Darcs-Hopefully.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" >Darcs.Hopefully</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" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AHopefully" >Hopefully</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Apiap" >piap</A > :: <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A > -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3An2pia" >n2pia</A > :: <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ApatchInfoAndPatch" >patchInfoAndPatch</A > :: <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A > -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p) -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Aconscientiously" >conscientiously</A > :: (<A HREF="Printer.html#t%3ADoc" >Doc</A > -> <A HREF="Printer.html#t%3ADoc" >Doc</A >) -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Ahopefully" >hopefully</A > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Ainfo" >info</A > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AhopefullyM" >hopefullyM</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Monad.html#t%3AMonad" >Monad</A > m => <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> m (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcreateHashed" >createHashed</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="Darcs-Witnesses-Sealed.html#t%3ASealed" >Sealed</A > a)) -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="Darcs-Witnesses-Sealed.html#t%3ASealed" >Sealed</A > (<A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > a))</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AextractHash" >extractHash</A > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither" >Either</A > (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p) <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%3Aactually" >actually</A > :: a -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Aunavailable" >unavailable</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > 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" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:Hopefully" ><A NAME="t%3AHopefully" ></A ></A ><B >Hopefully</B > a </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" ><TT ><TT ><A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A ></TT > p C</TT > <TT >(x y)</TT > is <TT ><TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither" >Either</A ></TT > String (p C</TT > <TT >(x y))</TT > in a form adapted to darcs patches. The <TT >C</TT > <TT >(x y)</TT > represents the type witness for the patch that should be there. The <TT >Hopefully</TT > type just tells whether we expect the patch to be hashed or not, and <TT >SimpleHopefully</TT > does the real work of emulating <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither" >Either</A ></TT >. <TT >Hopefully sh</TT > represents an expected unhashed patch, and <TT >Hashed hash sh</TT > represents an expected hashed patch with its hash. </TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:PatchInfoAnd" ><A NAME="t%3APatchInfoAnd" ></A ></A ><B >PatchInfoAnd</B > p </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" ><TT ><TT ><A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A ></TT > p </TT > represents a hope we have to get a patch through its info. We're not sure we have the patch, but we know its info. </TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:PatchInfoAnd')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:PatchInfoAnd" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="Darcs-Witnesses-Ordered.html#t%3AMyEq" >MyEq</A > p => <A HREF="Darcs-Witnesses-Ordered.html#t%3AMyEq" >MyEq</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Patchy.html#t%3AInvert" >Invert</A > p => <A HREF="Darcs-Patch-Patchy.html#t%3AInvert" >Invert</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Patchy.html#t%3AReadPatch" >ReadPatch</A > p => <A HREF="Darcs-Patch-Patchy.html#t%3AReadPatch" >ReadPatch</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" >(<A HREF="Darcs-Patch-Prim.html#t%3AConflict" >Conflict</A > p, <A HREF="Darcs-Patch-Prim.html#t%3AEffect" >Effect</A > p, <A HREF="Darcs-Patch-Patchy.html#t%3AShowPatch" >ShowPatch</A > p) => <A HREF="Darcs-Patch-Patchy.html#t%3AShowPatch" >ShowPatch</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Patchy.html#t%3ACommute" >Commute</A > p => <A HREF="Darcs-Patch-Patchy.html#t%3ACommute" >Commute</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Patchy.html#t%3AApply" >Apply</A > p => <A HREF="Darcs-Patch-Patchy.html#t%3AApply" >Apply</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch.html#t%3ARepoPatch" >RepoPatch</A > p => <A HREF="Darcs-Patch-Patchy.html#t%3APatchy" >Patchy</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Prim.html#t%3AEffect" >Effect</A > p => <A HREF="Darcs-Patch-Prim.html#t%3AEffect" >Effect</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="Darcs-Patch-Prim.html#t%3AConflict" >Conflict</A > p => <A HREF="Darcs-Patch-Prim.html#t%3AConflict" >Conflict</A > (<A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p)</TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:piap" ><A NAME="v%3Apiap" ></A ></A ><B >piap</B > :: <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A > -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="Darcs-Hopefully.html#v%3Apiap" >piap</A ></TT > i p</TT > creates a PatchInfoAnd containing p with info i. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:n2pia" ><A NAME="v%3An2pia" ></A ></A ><B >n2pia</B > :: <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="doc" ><TT >n2pia</TT > creates a PatchInfoAnd representing a <TT >Named</TT > patch. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:patchInfoAndPatch" ><A NAME="v%3ApatchInfoAndPatch" ></A ></A ><B >patchInfoAndPatch</B > :: <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A > -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p) -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:conscientiously" ><A NAME="v%3Aconscientiously" ></A ></A ><B >conscientiously</B > :: (<A HREF="Printer.html#t%3ADoc" >Doc</A > -> <A HREF="Printer.html#t%3ADoc" >Doc</A >) -> <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="Darcs-Hopefully.html#v%3Aconscientiously" >conscientiously</A ></TT > er hp</TT > tries to extract a patch from a <TT ><A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A ></TT >. If it fails, it applies the error handling function <TT >er</TT > to a description of the patch info component of <TT >hp</TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:hopefully" ><A NAME="v%3Ahopefully" ></A ></A ><B >hopefully</B > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p</TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="Darcs-Hopefully.html#v%3Ahopefully" >hopefully</A ></TT > hp</TT > tries to get a patch from a <TT ><A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A ></TT > value. If it fails, it outputs an error "failed to read patch: <description of the patch>". We get the description of the patch from the info part of hp </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:info" ><A NAME="v%3Ainfo" ></A ></A ><B >info</B > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="Darcs-Patch-Info.html#t%3APatchInfo" >PatchInfo</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:hopefullyM" ><A NAME="v%3AhopefullyM" ></A ></A ><B >hopefullyM</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Control-Monad.html#t%3AMonad" >Monad</A > m => <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> m (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p)</TD ></TR ><TR ><TD CLASS="doc" ><TT >hopefullyM</TT > is a version of <TT >hopefully</TT > which calls <TT >fail</TT > in a monad instead of erroring. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:createHashed" ><A NAME="v%3AcreateHashed" ></A ></A ><B >createHashed</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="Darcs-Witnesses-Sealed.html#t%3ASealed" >Sealed</A > a)) -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/System-IO.html#t%3AIO" >IO</A > (<A HREF="Darcs-Witnesses-Sealed.html#t%3ASealed" >Sealed</A > (<A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > a))</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:extractHash" ><A NAME="v%3AextractHash" ></A ></A ><B >extractHash</B > :: <A HREF="Darcs-Hopefully.html#t%3APatchInfoAnd" >PatchInfoAnd</A > p -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Either.html#t%3AEither" >Either</A > (<A HREF="Darcs-Patch-Core.html#t%3ANamed" >Named</A > p) <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="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:actually" ><A NAME="v%3Aactually" ></A ></A ><B >actually</B > :: a -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > a</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:unavailable" ><A NAME="v%3Aunavailable" ></A ></A ><B >unavailable</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.0/Data-Char.html#t%3AString" >String</A > -> <A HREF="Darcs-Hopefully.html#t%3AHopefully" >Hopefully</A > a</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.6.0</TD ></TR ></TABLE ></BODY ></HTML >