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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.PatchInfoAnd

Synopsis

- data Hopefully (a :: Type -> Type -> Type) wX wY
- type PatchInfoAnd (p :: Type -> Type -> Type) = PatchInfoAndG (Named p)
- data PatchInfoAndG (p :: Type -> Type -> Type) wA wB
- piap :: PatchInfo -> p wA wB -> PatchInfoAndG p wA wB
- n2pia :: (Ident p, PatchId p ~ PatchInfo) => p wX wY -> PatchInfoAndG p wX wY
- patchInfoAndPatch :: forall (p :: Type -> Type -> Type) wA wB. PatchInfo -> Hopefully p wA wB -> PatchInfoAndG p wA wB
- fmapPIAP :: (p wX wY -> q wX wY) -> PatchInfoAndG p wX wY -> PatchInfoAndG q wX wY
- fmapFLPIAP :: forall (p :: Type -> Type -> Type) wX wY (q :: Type -> Type -> Type). (FL p wX wY -> FL q wX wY) -> PatchInfoAnd p wX wY -> PatchInfoAnd q wX wY
- hopefully :: PatchInfoAndG p wA wB -> p wA wB
- info :: forall (p :: Type -> Type -> Type) wA wB. PatchInfoAndG p wA wB -> PatchInfo
- hopefullyM :: PatchInfoAndG p wA wB -> Maybe (p wA wB)
- createHashed :: forall (a :: Type -> Type -> Type) wX. PatchHash -> (PatchHash -> IO (Sealed (a wX))) -> IO (Sealed (Hopefully a wX))
- extractHash :: PatchInfoAndG p wA wB -> Either (p wA wB) PatchHash
- actually :: a wX wY -> Hopefully a wX wY
- unavailable :: forall (a :: Type -> Type -> Type) wX wY. String -> Hopefully a wX wY
- patchDesc :: forall (p :: Type -> Type -> Type) wX wY. PatchInfoAnd p wX wY -> String

# Documentation

data Hopefully (a :: Type -> Type -> Type) 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

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

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

piap :: PatchInfo -> p wA wB -> PatchInfoAndG p wA wB #

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

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

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

patchInfoAndPatch :: forall (p :: Type -> Type -> Type) wA wB. PatchInfo -> Hopefully p wA wB -> PatchInfoAndG p wA wB #

fmapPIAP :: (p wX wY -> q wX wY) -> PatchInfoAndG p wX wY -> PatchInfoAndG q wX wY #

fmapFLPIAP :: forall (p :: Type -> Type -> Type) wX wY (q :: Type -> Type -> Type). (FL p wX wY -> FL q wX wY) -> PatchInfoAnd p wX wY -> PatchInfoAnd q wX wY #

hopefully :: PatchInfoAndG 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 :: forall (p :: Type -> Type -> Type) wA wB. PatchInfoAndG p wA wB -> PatchInfo #

hopefullyM :: PatchInfoAndG p wA wB -> Maybe (p wA wB) #

Return `Just` the patch content or `Nothing` if it is unavailable.

createHashed :: forall (a :: Type -> Type -> Type) wX. PatchHash -> (PatchHash -> IO (Sealed (a wX))) -> IO (Sealed (Hopefully a wX)) #

extractHash :: PatchInfoAndG p wA wB -> Either (p wA wB) PatchHash #

actually :: a wX wY -> Hopefully a wX wY #

unavailable :: forall (a :: Type -> Type -> Type) wX wY. String -> Hopefully a wX wY #

patchDesc :: forall (p :: Type -> Type -> Type) wX wY. PatchInfoAnd p wX wY -> String #