darcs-2.16.5: a distributed, interactive, smart revision control system

Safe Haskell | Safe-Inferred
Language | Haskell2010

Darcs.Patch.PatchInfoAnd

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 #

``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.

#### Instances

Instances details

Show (a wX wY) => Show (Hopefully a wX wY) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showsPrec :: Int -> Hopefully a wX wY -> ShowS # show :: Hopefully a wX wY -> String # showList :: [Hopefully a wX wY] -> ShowS #

type PatchInfoAnd rt p = PatchInfoAndG rt (Named p) #

data PatchInfoAndG (rt :: RepoType) p wA wB #

``PatchInfoAnd` p wA wB` 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.

#### Instances

Instances details

Apply p => Apply (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Associated Types type ApplyState (PatchInfoAndG rt p) :: (Type -> Type) -> Type # Methods apply :: ApplyMonad (ApplyState (PatchInfoAndG rt p)) m => PatchInfoAndG rt p wX wY -> m () # unapply :: ApplyMonad (ApplyState (PatchInfoAndG rt p)) m => PatchInfoAndG rt p wX wY -> m () #
(PatchId p ~ PatchInfo, Commute p) => Commute (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods commute :: (PatchInfoAndG rt p :> PatchInfoAndG rt p) wX wY -> Maybe ((PatchInfoAndG rt p :> PatchInfoAndG rt p) wX wY) #
(Commute p, Conflict p) => Conflict (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods resolveConflicts :: RL (PatchInfoAnd rt p) wO wX -> RL (PatchInfoAnd rt p) wX wY -> [ConflictDetails (PrimOf (PatchInfoAnd rt p)) wY] #
PatchDebug p => PatchDebug (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods patchDebugDummy :: PatchInfoAndG rt p wX wY -> () #
Effect p => Effect (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods effect :: PatchInfoAndG rt p wX wY -> FL (PrimOf (PatchInfoAndG rt p)) wX wY #
IsHunk (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods isHunk :: PatchInfoAndG rt p wX wY -> Maybe (FileHunk wX wY) #
PatchListFormat (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods patchListFormat :: ListFormat (PatchInfoAndG rt p) #
PrimPatchBase p => PrimPatchBase (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Associated Types type PrimOf (PatchInfoAndG rt p) :: Type -> Type -> Type #
IdEq2 (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods (=\^/=) :: PatchInfoAndG rt p wA wB -> PatchInfoAndG rt p wA wC -> EqCheck wB wC # (=/^\=) :: PatchInfoAndG rt p wA wC -> PatchInfoAndG rt p wB wC -> EqCheck wA wB #
Ident (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods ident :: PatchInfoAndG rt p wX wY -> PatchId (PatchInfoAndG rt p) #
PatchInspect p => PatchInspect (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods listTouchedFiles :: PatchInfoAndG rt p wX wY -> [AnchoredPath] # hunkMatches :: (ByteString -> Bool) -> PatchInfoAndG rt p wX wY -> Bool #
(PatchId p ~ PatchInfo, CleanMerge p) => CleanMerge (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods cleanMerge :: (PatchInfoAndG rt p :\/: PatchInfoAndG rt p) wX wY -> Maybe ((PatchInfoAndG rt p :/\: PatchInfoAndG rt p) wX wY) #
(PatchId p ~ PatchInfo, Merge p) => Merge (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods merge :: (PatchInfoAndG rt p :\/: PatchInfoAndG rt p) wX wY -> (PatchInfoAndG rt p :/\: PatchInfoAndG rt p) wX wY #
(ReadPatch p, Ident p, PatchId p ~ PatchInfo) => ReadPatch (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods readPatch' :: Parser (Sealed (PatchInfoAndG rt p wX)) #
RepairToFL p => Repair (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods applyAndTryToFix :: ApplyMonad (ApplyState (PatchInfoAnd rt p)) m => PatchInfoAnd rt p wX wY -> m (Maybe (String, PatchInfoAnd rt p wX wY)) #
ShowContextPatch p => ShowContextPatch (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showContextPatch :: ApplyMonad (ApplyState (PatchInfoAndG rt p)) m => ShowPatchFor -> PatchInfoAndG rt p wX wY -> m Doc #
(Summary p, PatchListFormat p, ShowPatch p) => ShowPatch (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods content :: PatchInfoAndG rt p wX wY -> Doc # description :: PatchInfoAndG rt p wX wY -> Doc # summary :: PatchInfoAndG rt p wX wY -> Doc # summaryFL :: FL (PatchInfoAndG rt p) wX wY -> Doc # thing :: PatchInfoAndG rt p wX wY -> String # things :: PatchInfoAndG rt p wX wY -> String #
ShowPatchBasic p => ShowPatchBasic (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showPatch :: ShowPatchFor -> PatchInfoAndG rt p wX wY -> Doc #
Eq2 (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods unsafeCompare :: PatchInfoAndG rt p wA wB -> PatchInfoAndG rt p wC wD -> Bool # (=\/=) :: PatchInfoAndG rt p wA wB -> PatchInfoAndG rt p wA wC -> EqCheck wB wC # (=/\=) :: PatchInfoAndG rt p wA wC -> PatchInfoAndG rt p wB wC -> EqCheck wA wB #
Show2 p => Show2 (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict2 :: ShowDict (PatchInfoAnd rt p wX wY) #
Show2 p => Show1 (PatchInfoAnd rt p wX) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict1 :: Dict (Show (PatchInfoAnd rt p wX wX0)) #
Show (p wA wB) => Show (PatchInfoAndG rt p wA wB) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showsPrec :: Int -> PatchInfoAndG rt p wA wB -> ShowS # show :: PatchInfoAndG rt p wA wB -> String # showList :: [PatchInfoAndG rt p wA wB] -> ShowS #
type ApplyState (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd type ApplyState (PatchInfoAndG rt p) = ApplyState p
type PrimOf (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd type PrimOf (PatchInfoAndG rt p) = PrimOf p
type PatchId (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd type PatchId (PatchInfoAndG rt p) = PatchInfo

data WPatchInfo wA wB #

``WPatchInfo` wA wB` represents the info of a patch, marked with the patch's witnesses.

#### Instances

Instances details

Eq2 WPatchInfo # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods unsafeCompare :: WPatchInfo wA wB -> WPatchInfo wC wD -> Bool # (=\/=) :: WPatchInfo wA wB -> WPatchInfo wA wC -> EqCheck wB wC # (=/\=) :: WPatchInfo wA wC -> WPatchInfo wB wC -> EqCheck 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 #

``piap` i p` creates a PatchInfoAnd containing p with info i.

n2pia :: (Ident p, PatchId p ~ PatchInfo) => p wX wY -> PatchInfoAndG rt p wX wY #

`n2pia` creates a PatchInfoAnd representing a `Named` patch.

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 #

``conscientiously` er hp` tries to extract a patch from a `PatchInfoAnd`. 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 #

``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`

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) #

`hopefullyM` is a version of `hopefully` which calls `fail` in a monad instead of erroring.

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 #