Documentation

Hopefully p C(x y) is Either String (p C(x y)) in a
form adapted to darcs patches. The C(x y) represents the type
witness for the patch that should be there. The Hopefully type
just tells whether we expect the patch to be hashed or not, and
SimpleHopefully does the real work of emulating
Either. Hopefully sh represents an expected unhashed patch, and
Hashed hash sh represents an expected hashed patch with its hash.

hopefully hp tries to get a patch from a PatchInfoAnd
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