Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Hopefully a wX wY
- type PatchInfoAnd rt p = PatchInfoAndG rt (Named p)
- data PatchInfoAndG (rt :: RepoType) p wA wB
- data WPatchInfo wA wB
- unWPatchInfo :: WPatchInfo wA wB -> PatchInfo
- compareWPatchInfo :: WPatchInfo wA wB -> WPatchInfo wC wD -> EqCheck (wA, wB) (wC, wD)
- piap :: PatchInfo -> p wA wB -> PatchInfoAndG rt p wA wB
- n2pia :: (Ident p, PatchId p ~ PatchInfo) => p wX wY -> PatchInfoAndG rt p wX wY
- patchInfoAndPatch :: PatchInfo -> Hopefully p wA wB -> PatchInfoAndG rt p wA wB
- fmapPIAP :: (p wX wY -> q wX wY) -> PatchInfoAndG rt p wX wY -> PatchInfoAndG rt q wX wY
- fmapFLPIAP :: (FL p wX wY -> FL q wX wY) -> PatchInfoAnd rt p wX wY -> PatchInfoAnd rt q wX wY
- conscientiously :: (Doc -> Doc) -> PatchInfoAndG rt p wA wB -> p wA wB
- hopefully :: PatchInfoAndG rt p wA wB -> p wA wB
- info :: PatchInfoAndG rt p wA wB -> PatchInfo
- winfo :: PatchInfoAnd rt p wA wB -> WPatchInfo wA wB
- hopefullyM :: PatchInfoAndG rt p wA wB -> Maybe (p wA wB)
- createHashed :: String -> (String -> IO (Sealed (a wX))) -> IO (Sealed (Hopefully a wX))
- extractHash :: PatchInfoAndG rt p wA wB -> Either (p wA wB) String
- actually :: a wX wY -> Hopefully a wX wY
- unavailable :: String -> Hopefully a wX wY
- patchDesc :: forall rt p wX wY. PatchInfoAnd rt p wX wY -> String
Documentation
data Hopefully a wX wY Source #
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.
type PatchInfoAnd rt p = PatchInfoAndG rt (Named p) Source #
data PatchInfoAndG (rt :: RepoType) p wA wB Source #
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.PatchInfoAnd
p wA wB
Instances
data WPatchInfo wA wB Source #
represents the info of a patch, marked with
the patch's witnesses.WPatchInfo
wA wB
Instances
Eq2 WPatchInfo Source # | |
Defined in Darcs.Patch.PatchInfoAnd unsafeCompare :: WPatchInfo wA wB -> WPatchInfo wC wD -> Bool Source # (=\/=) :: WPatchInfo wA wB -> WPatchInfo wA wC -> EqCheck wB wC Source # (=/\=) :: WPatchInfo wA wC -> WPatchInfo wB wC -> EqCheck wA wB Source # |
unWPatchInfo :: WPatchInfo wA wB -> PatchInfo Source #
compareWPatchInfo :: WPatchInfo wA wB -> WPatchInfo wC wD -> EqCheck (wA, wB) (wC, wD) Source #
piap :: PatchInfo -> p wA wB -> PatchInfoAndG rt p wA wB Source #
creates a PatchInfoAnd containing p with info i.piap
i p
n2pia :: (Ident p, PatchId p ~ PatchInfo) => p wX wY -> PatchInfoAndG rt p wX wY Source #
n2pia
creates a PatchInfoAnd representing a Named
patch.
patchInfoAndPatch :: PatchInfo -> Hopefully p wA wB -> PatchInfoAndG rt p wA wB Source #
fmapPIAP :: (p wX wY -> q wX wY) -> PatchInfoAndG rt p wX wY -> PatchInfoAndG rt q wX wY Source #
fmapFLPIAP :: (FL p wX wY -> FL q wX wY) -> PatchInfoAnd rt p wX wY -> PatchInfoAnd rt q wX wY Source #
conscientiously :: (Doc -> Doc) -> PatchInfoAndG rt p wA wB -> p wA wB Source #
tries to extract a patch from a conscientiously
er hpPatchInfoAnd
.
If it fails, it applies the error handling function er
to a description
of the patch info component of hp
.
Note: this function must be lazy in its second argument, which is why we
use a lazy pattern match.
hopefully :: PatchInfoAndG rt p wA wB -> p wA wB Source #
tries to get a patch from a hopefully
hpPatchInfoAnd
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
info :: PatchInfoAndG rt p wA wB -> PatchInfo Source #
winfo :: PatchInfoAnd rt p wA wB -> WPatchInfo wA wB Source #
hopefullyM :: PatchInfoAndG rt p wA wB -> Maybe (p wA wB) Source #
hopefullyM
is a version of hopefully
which calls fail
in a
monad instead of erroring.
extractHash :: PatchInfoAndG rt p wA wB -> Either (p wA wB) String Source #
unavailable :: String -> Hopefully a wX wY Source #
patchDesc :: forall rt p wX wY. PatchInfoAnd rt p wX wY -> String Source #