Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class PrimPatch (PrimOf p) => PrimPatchBase p where
- type PrimOf (p :: * -> * -> *) :: * -> * -> *
- data Named p wX wY
- type family ApplyState p :: (* -> *) -> *
- rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY
- hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY
- tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY
- anonymous :: FromPrim p => FL (PrimOf p) wX wY -> IO (Named p wX wY)
- binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY
- description :: ShowPatch p => p wX wY -> Doc
- showPatchWithContext :: (ApplyMonadTrans (ApplyState p) m, ShowContextPatch p) => ShowPatchFor -> ApplyState p m -> p wX wY -> m Doc
- data ShowPatchFor
- showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc
- displayPatch :: ShowPatchBasic p => p wX wY -> Doc
- content :: ShowPatch p => p wX wY -> Doc
- infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY
- changepref :: PrimConstruct prim => String -> String -> String -> prim wX wY
- thing :: ShowPatch p => p wX wY -> String
- things :: ShowPatch p => p wX wY -> String
- merge :: Merge p => (p :\/: p) wX wY -> (p :/\: p) wX wY
- commute :: Commute p => (p :> p) wX wY -> Maybe ((p :> p) wX wY)
- listTouchedFiles :: PatchInspect p => p wX wY -> [AnchoredPath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool
- forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString
- type PrimPatch prim = (Annotate prim, Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCoalesce prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim)
- resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY]
- class Effect p
- effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY
- invert :: Invert p => p wX wY -> p wY wX
- invertFL :: Invert p => FL p wX wY -> RL p wY wX
- invertRL :: Invert p => RL p wX wY -> FL p wY wX
- commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY)
- commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: ReadPatch p => ByteString -> Either String (Sealed (p wX))
- readPatchPartial :: ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString)
- canonizeFL :: (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY
- sortCoalesceFL :: PrimCoalesce prim => FL prim wX wY -> FL prim wX wY
- tryToShrink :: PrimCoalesce prim => FL prim wX wY -> Maybe (FL prim wX wY)
- patchname :: Named p wX wY -> String
- patchcontents :: Named p wX wY -> FL p wX wY
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)
- maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m))
- effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath]
- patch2patchinfo :: Named p wX wY -> PatchInfo
- summary :: ShowPatch p => p wX wY -> Doc
- summaryFL :: ShowPatch p => FL p wX wY -> Doc
- plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc
- xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc
- plainSummaryPrims :: PrimDetails prim => Bool -> FL prim wX wY -> Doc
- adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY
- getdeps :: HasDeps p => p wX wY -> [PatchInfo]
- listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath]
- isInconsistent :: Check p => p wX wY -> Maybe Doc
- type RepoPatch p = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p)
- type PatchInfoAnd p = PatchInfoAndG (Named p)
- hopefully :: PatchInfoAndG p wA wB -> p wA wB
- info :: PatchInfoAndG p wA wB -> PatchInfo
Documentation
class PrimPatch (PrimOf p) => PrimPatchBase p Source #
Instances
PrimPatchBase p => PrimPatchBase (Invertible p) Source # | |
Defined in Darcs.Patch.Invertible | |
PrimPatchBase p => PrimPatchBase (Named p) Source # | |
PrimPatchBase p => PrimPatchBase (PatchInfoAndG p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd | |
PrimPatch prim => PrimPatchBase (RebaseChange prim) Source # | |
Defined in Darcs.Patch.Rebase.Change | |
PrimPatchBase p => PrimPatchBase (WithDroppedDeps p) Source # | |
Defined in Darcs.Patch.Rebase.Change | |
PrimPatch prim => PrimPatchBase (RebaseFixup prim) Source # | |
Defined in Darcs.Patch.Rebase.Fixup | |
PrimPatch prim => PrimPatchBase (RepoPatchV1 prim) Source # | |
Defined in Darcs.Patch.V1.Core | |
PrimPatch prim => PrimPatchBase (RepoPatchV2 prim) Source # | |
Defined in Darcs.Patch.V2.RepoPatch | |
PrimPatchBase p => PrimPatchBase (FL p) Source # | |
PrimPatchBase p => PrimPatchBase (RL p) Source # | |
PrimPatch prim => PrimPatchBase (RepoPatchV3 name prim) Source # | |
Defined in Darcs.Patch.V3.Core |
The Named
type adds a patch info about a patch, that is a name.
NamedP info deps p
represents patch p
with name
info
. deps
is a list of dependencies added at the named patch
level, compared with the unnamed level (ie, dependencies added with
darcs record --ask-deps
).
Instances
Apply p => Apply (Named p) Source # | |
Defined in Darcs.Patch.Named apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () Source # unapply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () Source # | |
Commute p => Commute (Named p) Source # | |
(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (Named p) Source # | This instance takes care of handling the interaction between conflict resolution and explicit dependencies. A conflict involves a set of two or more patches and the general rule is that the conflict is considered resolved if there is another (later) patch that (transitively) depends on each of the (mutually) conflicting patches. This principle extends to explicit dependencies between In general a Named A [] a Named B [] (b1;b2) Named C [] c Named D [A,B] _ where, at the RepoPatch level, When we decide that a set of conflicting Named patches is resolved, we move the RepoPatches contained in them to the context of the resolution. For all other named patches, we must commute as much of their contents as possible past the ones marked as resolved, using commutation at the RepoPatch level (i.e. ignoring explicit dependencies). |
Defined in Darcs.Patch.Named isConflicted :: Named p wX wY -> Bool Source # resolveConflicts :: RL (Named p) wO wX -> RL (Named p) wX wY -> [ConflictDetails (PrimOf (Named p)) wY] Source # | |
(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (PatchInfoAnd p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd isConflicted :: PatchInfoAnd p wX wY -> Bool Source # resolveConflicts :: RL (PatchInfoAnd p) wO wX -> RL (PatchInfoAnd p) wX wY -> [ConflictDetails (PrimOf (PatchInfoAnd p)) wY] Source # | |
PatchDebug p => PatchDebug (Named p) Source # | |
Defined in Darcs.Patch.Named patchDebugDummy :: Named p wX wY -> () Source # | |
Effect p => Effect (Named p) Source # | |
IsHunk (Named p) Source # | |
Defined in Darcs.Patch.Named | |
PatchListFormat (Named p) Source # | |
Defined in Darcs.Patch.Named patchListFormat :: ListFormat (Named p) Source # | |
PrimPatchBase p => PrimPatchBase (Named p) Source # | |
Ident (Named p) Source # | |
PatchInspect p => PatchInspect (Named p) Source # | |
Defined in Darcs.Patch.Named listTouchedFiles :: Named p wX wY -> [AnchoredPath] Source # hunkMatches :: (ByteString -> Bool) -> Named p wX wY -> Bool Source # | |
CleanMerge p => CleanMerge (Named p) Source # | |
Merge p => Merge (Named p) Source # | |
HasDeps (Named p) Source # | |
(ReadPatch p, PatchListFormat p) => ReadPatch (Named p) Source # | |
Defined in Darcs.Patch.Named | |
Check p => Check (Named p) Source # | |
Defined in Darcs.Patch.Named | |
RepairToFL p => Repair (Named p) Source # | |
Defined in Darcs.Patch.Named applyAndTryToFix :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m (Maybe (String, Named p wX wY)) Source # | |
RepairToFL p => Repair (PatchInfoAnd p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd applyAndTryToFix :: ApplyMonad (ApplyState (PatchInfoAnd p)) m => PatchInfoAnd p wX wY -> m (Maybe (String, PatchInfoAnd p wX wY)) Source # | |
(Apply p, IsHunk p, PatchListFormat p, ObjectId (ObjectIdOfPatch p), ShowContextPatch p) => ShowContextPatch (Named p) Source # | |
Defined in Darcs.Patch.Named showPatchWithContextAndApply :: ApplyMonad (ApplyState (Named p)) m => ShowPatchFor -> Named p wX wY -> m Doc Source # | |
(Summary p, PatchListFormat p, PrimPatchBase p, ShowPatch p) => ShowPatch (Named p) Source # | |
(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) Source # | |
Defined in Darcs.Patch.Named | |
Summary p => Summary (Named p) Source # | |
Defined in Darcs.Patch.Named conflictedEffect :: Named p wX wY -> [IsConflictedPrim (PrimOf (Named p))] Source # | |
(PrimPatchBase p, Unwind p) => Unwind (Named p) Source # | |
Defined in Darcs.Patch.Named | |
(Commute p, Eq2 p) => Eq2 (Named p) Source # | |
Show2 p => Show2 (Named p) Source # | |
Defined in Darcs.Patch.Named | |
Show2 p => Show2 (PatchInfoAnd p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd showDict2 :: ShowDict (PatchInfoAnd p wX wY) Source # | |
Show2 p => Show1 (Named p wX) Source # | |
Show2 p => Show1 (PatchInfoAnd p wX) Source # | |
Defined in Darcs.Patch.PatchInfoAnd | |
Show2 p => Show (Named p wX wY) Source # | |
type ApplyState (Named p) Source # | |
Defined in Darcs.Patch.Named | |
type PrimOf (Named p) Source # | |
Defined in Darcs.Patch.Named | |
type PatchId (Named p) Source # | |
Defined in Darcs.Patch.Named |
type family ApplyState p :: (* -> *) -> * Source #
Instances
rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY Source #
hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY Source #
tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY Source #
binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY Source #
description :: ShowPatch p => p wX wY -> Doc Source #
showPatchWithContext :: (ApplyMonadTrans (ApplyState p) m, ShowContextPatch p) => ShowPatchFor -> ApplyState p m -> p wX wY -> m Doc Source #
Like showPatchWithContextAndApply
but without applying the patch
in the monad m
.
showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc Source #
displayPatch :: ShowPatchBasic p => p wX wY -> Doc Source #
infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY Source #
changepref :: PrimConstruct prim => String -> String -> String -> prim wX wY Source #
listTouchedFiles :: PatchInspect p => p wX wY -> [AnchoredPath] Source #
hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool Source #
forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString Source #
forceTokReplace tokChars old new input
replaces all occurrences of
the old
token with the new
one, throughout the input
.
type PrimPatch prim = (Annotate prim, Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCoalesce prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim) Source #
for PatchTest
resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY] Source #
The first parameter is a context containing all patches
preceding the ones for which we want to calculate the conflict
resolution, which is the second parameter.
Each element of the result list represents the resolution
of one maximal set of transitively conflicting alternatives,
in other words, a connected subset of the conflict graph.
But the elements themselves must not conflict with each other,
guaranteeing that they can be cleanly merged into a single FL
of prims.
Patches whose concrete effect can be expressed as a list of primitive patches.
A minimal definition would be either of effect
or effectRL
.
Instances
Effect p => Effect (Named p) Source # | |
Effect p => Effect (PatchInfoAndG p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd effect :: PatchInfoAndG p wX wY -> FL (PrimOf (PatchInfoAndG p)) wX wY Source # | |
Effect p => Effect (WithDroppedDeps p) Source # | |
Defined in Darcs.Patch.Rebase.Change effect :: WithDroppedDeps p wX wY -> FL (PrimOf (WithDroppedDeps p)) wX wY Source # | |
PrimPatch prim => Effect (RepoPatchV1 prim) Source # | |
Defined in Darcs.Patch.V1.Commute effect :: RepoPatchV1 prim wX wY -> FL (PrimOf (RepoPatchV1 prim)) wX wY Source # | |
PrimPatch prim => Effect (RepoPatchV2 prim) Source # | |
Defined in Darcs.Patch.V2.RepoPatch effect :: RepoPatchV2 prim wX wY -> FL (PrimOf (RepoPatchV2 prim)) wX wY Source # | |
Effect p => Effect (FL p) Source # | |
Effect p => Effect (RL p) Source # | |
Effect (RepoPatchV3 name prim) Source # | |
Defined in Darcs.Patch.V3.Core effect :: RepoPatchV3 name prim wX wY -> FL (PrimOf (RepoPatchV3 name prim)) wX wY Source # |
commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) Source #
commuteFL
commutes a single element past a FL.
commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY) Source #
commuteRL
commutes a RL past a single element.
readPatchPartial :: ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString) Source #
canonizeFL :: (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY Source #
Put a sequence of primitive patches into canonical form.
Even if the patches are just hunk patches, this is not necessarily the same set of results as you would get if you applied the sequence to a specific tree and recalculated a diff.
XXX Why not? How does it differ? The implementation for Prim.V1 does sortCoalesceFL and then invokes the diff algorithm for each hunk. How can that be any different to applying the sequence and then taking the diff? Is this merely because diff does not sort by file path?
Besides, diff and apply must be inverses in the sense that for any two states {start, end}, we have
diff start (apply (diff start end)) == end
sortCoalesceFL :: PrimCoalesce prim => FL prim wX wY -> FL prim wX wY Source #
This is similar to tryToShrink
but always gives back a result: if the
sequence could not be shrunk we merely give back a sorted version.
This method is included in the class for optimization. Instances are free
to use defaultSortCoalesceFL
.
tryToShrink :: PrimCoalesce prim => FL prim wX wY -> Maybe (FL prim wX wY) Source #
Try to shrink the input sequence by getting rid of self-cancellations
and identity patches or by coalescing patches. Also sort patches
according to some internally defined order (specific to the patch type)
as far as possible while respecting dependencies.
A result of Nothing
means that we could not shrink the input.
This method is included in the class for optimization. Instances are free
to use defaultTryToShrink
.
patchcontents :: Named p wX wY -> FL p wX wY Source #
apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () Source #
applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) Source #
maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m)) Source #
Attempts to apply a given patch to a Tree. If the apply fails, we return Nothing, otherwise we return the updated Tree.
effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath] Source #
patch2patchinfo :: Named p wX wY -> PatchInfo Source #
plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc Source #
xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc Source #
plainSummaryPrims :: PrimDetails prim => Bool -> FL prim wX wY -> Doc Source #
listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath] Source #
type RepoPatch p = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p) Source #
type PatchInfoAnd p = PatchInfoAndG (Named p) Source #
hopefully :: PatchInfoAndG 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 p wA wB -> PatchInfo Source #