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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch

Contents

- for PatchTest
- Orphan instances

Synopsis

- class (Patchy p, Merge p, Effect p, IsHunk p, PatchInspect p, ReadPatch p, ShowPatch p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p), Matchable p) => RepoPatch p
- data RepoType
- class IsRepoType rt
- data Named p wX wY
- data WrappedNamed rt p wX wY
- class (Apply p, Commute p, Invert p) => Patchy p
- fromPrim :: FromPrim p => PrimOf p wX wY -> p wX wY
- fromPrims :: FromPrims p => FL (PrimOf p) wX wY -> p wX wY
- rmfile :: PrimConstruct prim => FilePath -> prim wX wY
- addfile :: PrimConstruct prim => FilePath -> prim wX wY
- rmdir :: PrimConstruct prim => FilePath -> prim wX wY
- adddir :: PrimConstruct prim => FilePath -> prim wX wY
- move :: PrimConstruct prim => FilePath -> FilePath -> prim wX wY
- hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim wX wY
- tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim wX wY
- namepatch :: String -> String -> String -> [String] -> FL p wX wY -> IO (Named p wX wY)
- anonymous :: FL p wX wY -> IO (Named p wX wY)
- binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim wX wY
- description :: ShowPatch p => p wX wY -> Doc
- showContextPatch :: (ShowPatch p, Monad m, ApplyMonad (ApplyState p) m) => p wX wY -> m Doc
- showPatch :: ShowPatchBasic p => p wX wY -> Doc
- showNicely :: ShowPatch p => p wX wY -> Doc
- infopatch :: PatchInfo -> FL 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
- primIsAddfile :: PrimClassify prim => prim wX wY -> Bool
- primIsHunk :: PrimClassify prim => prim wX wY -> Bool
- primIsSetpref :: PrimClassify prim => prim wX wY -> Bool
- 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 -> [FilePath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool
- forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString
- class (Patchy prim, MyEq prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PatchInspect prim, ReadPatch prim, ShowPatch prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim
- resolveConflicts :: Conflict p => p wX wY -> [[Sealed (FL (PrimOf p) wY)]]
- class Effect p where
- effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY
- primIsBinary :: PrimClassify prim => prim wX wY -> Bool
- primIsAdddir :: PrimClassify prim => prim wX wY -> Bool
- 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)
- commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY)
- commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: ReadPatch p => ByteString -> Maybe (Sealed (p wX))
- readPatchPartial :: ReadPatch p => ByteString -> Maybe (Sealed (p wX), ByteString)
- canonize :: PrimCanonize prim => DiffAlgorithm -> prim wX wY -> FL prim wX wY
- sortCoalesceFL :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY
- tryToShrink :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY
- patchname :: Named p wX wY -> String
- patchcontents :: Named p wX wY -> FL p wX wY
- applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)])
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)
- maybeApplyToTree :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Tree IO -> IO (Maybe (Tree IO))
- effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath]
- patch2patchinfo :: Named p wX wY -> PatchInfo
- summary :: ShowPatch p => p wX wY -> Doc
- summaryFL :: ShowPatch p => FL p wX wY -> Doc
- plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e wX wY -> Doc
- xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p wX wY -> Doc
- plainSummaryPrims :: PrimDetails prim => Bool -> [FileName] -> FL prim wX wY -> Doc
- adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY
- getdeps :: Named p wX wY -> [PatchInfo]
- listConflictedFiles :: Conflict p => p wX wY -> [FilePath]
- isInconsistent :: Check p => p wX wY -> Maybe Doc

# Documentation

class (Patchy p, Merge p, Effect p, IsHunk p, PatchInspect p, ReadPatch p, ShowPatch p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p), Matchable p) => RepoPatch p #

Instances

RepoPatch DummyPatch # |

data RepoType #

This type is intended to be used as a phantom type via the `DataKinds` extension. It tracks different types of repositories, e.g. to indicate when a rebase is in progress.

class IsRepoType rt #

Minimal complete definition

singletonRepoType

Instances

IsRebaseType rebaseType => IsRepoType (RepoType rebaseType) # |
Methods singletonRepoType :: SRepoType (RepoType rebaseType) #

data Named p wX wY #

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

Show2 p => Show2 (Named p) # |
Methods showDict2 :: ShowDict (Named p wX wY) #
(Commute p, MyEq p) => MyEq (Named p) # |
Methods unsafeCompare :: Named p wA wB -> Named p wC wD -> Bool # (=\/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC # (=/\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB #
PatchListFormat (Named p) # |
Methods patchListFormat :: ListFormat (Named p) #
Commute p => Commute (Named p) # |
Methods commute :: (Named p :> Named p) wX wY -> Maybe ((Named p :> Named p) wX wY) #
PatchDebug p => PatchDebug (Named p) # |
Methods patchDebugDummy :: Named p wX wY -> () #
PatchInspect p => PatchInspect (Named p) # |
Methods listTouchedFiles :: Named p wX wY -> [FilePath] # hunkMatches :: (ByteString -> Bool) -> Named p wX wY -> Bool #
Invert p => Invert (Named p) # |
Methods invert :: Named p wX wY -> Named p wY wX #
Merge p => Merge (Named p) # |
Methods merge :: (Named p :\/: Named p) wX wY -> (Named p :/\: Named p) wX wY #
(ReadPatch p, PatchListFormat p) => ReadPatch (Named p) # |
Methods readPatch' :: ParserM m => m (Sealed (Named p wX)) #
Apply p => Apply (Named p) # |
Associated Types type ApplyState (Named p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #
RepairToFL p => Repair (Named p) # |
Methods applyAndTryToFix :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m (Maybe (String, Named p wX wY)) #
Check p => Check (Named p) # |
Methods isInconsistent :: Named p wX wY -> Maybe Doc #
(Apply p, CommuteNoConflicts p, Conflict p, IsHunk p, PatchListFormat p, PrimPatchBase p, ShowPatch p) => ShowPatch (Named p) # |
Methods showNicely :: Named p wX wY -> Doc # showContextPatch :: (Monad m, ApplyMonad (ApplyState (Named p)) m) => Named p wX wY -> m Doc # description :: Named p wX wY -> Doc # summary :: Named p wX wY -> Doc # summaryFL :: FL (Named p) wX wY -> Doc # thing :: Named p wX wY -> String # things :: Named p wX wY -> String #
(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) # |
Methods showPatch :: Named p wX wY -> Doc #
IsHunk (Named p) # |
Methods isHunk :: Named p wX wY -> Maybe (FileHunk wX wY) #
PrimPatchBase p => PrimPatchBase (Named p) # |
Associated Types type PrimOf (Named p :: * -> * -> *) :: * -> * -> * #
Effect p => Effect (Named p) # |
Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY # effectRL :: Named p wX wY -> RL (PrimOf (Named p)) wX wY #
(CommuteNoConflicts p, Conflict p) => Conflict (Named p) # |
Methods resolveConflicts :: Named p wX wY -> [[Sealed (FL (PrimOf (Named p)) wY)]] # conflictedEffect :: Named p wX wY -> [IsConflictedPrim (PrimOf (Named p))] #
Show2 p => Show1 (Named p wX) # |
Methods showDict1 :: ShowDict (Named p wX wX) #
Show2 p => Show (Named p wX wY) # |
Methods showsPrec :: Int -> Named p wX wY -> ShowS # show :: Named p wX wY -> String # showList :: [Named p wX wY] -> ShowS #
type ApplyState (Named p) # |
type ApplyState (Named p) = ApplyState p
type PrimOf (Named p) # |
type PrimOf (Named p) = PrimOf p

data WrappedNamed rt p wX wY #

A layer inbetween the 'Named p' type and 'PatchInfoAnd p' design for holding "internal" patches such as the rebase container. Ideally these patches would be stored at the repository level but this would require some significant refactoring/cleaning up of that code.

Instances

Show2 p => Show2 (WrappedNamed rt p) # |
Methods showDict2 :: ShowDict (WrappedNamed rt p wX wY) #
PatchListFormat (WrappedNamed rt p) # |
Methods patchListFormat :: ListFormat (WrappedNamed rt p) #
Commute p => Commute (WrappedNamed rt p) # |
Methods commute :: (WrappedNamed rt p :> WrappedNamed rt p) wX wY -> Maybe ((WrappedNamed rt p :> WrappedNamed rt p) wX wY) #
PatchInspect p => PatchInspect (WrappedNamed rt p) # |
Methods listTouchedFiles :: WrappedNamed rt p wX wY -> [FilePath] # hunkMatches :: (ByteString -> Bool) -> WrappedNamed rt p wX wY -> Bool #
Invert p => Invert (WrappedNamed rt p) # |
Methods invert :: WrappedNamed rt p wX wY -> WrappedNamed rt p wY wX #
Merge p => Merge (WrappedNamed rt p) # |
Methods merge :: (WrappedNamed rt p :\/: WrappedNamed rt p) wX wY -> (WrappedNamed rt p :/\: WrappedNamed rt p) wX wY #
(ReadPatch p, PrimPatchBase p, FromPrim p, Effect p, PatchListFormat p, IsRepoType rt) => ReadPatch (WrappedNamed rt p) # |
Methods readPatch' :: ParserM m => m (Sealed (WrappedNamed rt p wX)) #
Apply p => Apply (WrappedNamed rt p) # |
Associated Types type ApplyState (WrappedNamed rt p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (WrappedNamed rt p)) m => WrappedNamed rt p wX wY -> m () #
RepairToFL p => Repair (WrappedNamed rt p) # |
Methods applyAndTryToFix :: ApplyMonad (ApplyState (WrappedNamed rt p)) m => WrappedNamed rt p wX wY -> m (Maybe (String, WrappedNamed rt p wX wY)) #
Check p => Check (WrappedNamed rt p) # |
Methods isInconsistent :: WrappedNamed rt p wX wY -> Maybe Doc #
(ShowPatch p, PatchListFormat p, Apply p, PrimPatchBase p, IsHunk p, Conflict p, CommuteNoConflicts p) => ShowPatch (WrappedNamed rt p) # |
Methods showNicely :: WrappedNamed rt p wX wY -> Doc # showContextPatch :: (Monad m, ApplyMonad (ApplyState (WrappedNamed rt p)) m) => WrappedNamed rt p wX wY -> m Doc # description :: WrappedNamed rt p wX wY -> Doc # summary :: WrappedNamed rt p wX wY -> Doc # summaryFL :: FL (WrappedNamed rt p) wX wY -> Doc # thing :: WrappedNamed rt p wX wY -> String # things :: WrappedNamed rt p wX wY -> String #
(ShowPatchBasic p, PatchListFormat p) => ShowPatchBasic (WrappedNamed rt p) # |
Methods showPatch :: WrappedNamed rt p wX wY -> Doc #
IsHunk (WrappedNamed rt p) # |
Methods isHunk :: WrappedNamed rt p wX wY -> Maybe (FileHunk wX wY) #
PrimPatchBase p => PrimPatchBase (WrappedNamed rt p) # |
Associated Types type PrimOf (WrappedNamed rt p :: * -> * -> *) :: * -> * -> * #
Effect p => Effect (WrappedNamed rt p) # |
Methods effect :: WrappedNamed rt p wX wY -> FL (PrimOf (WrappedNamed rt p)) wX wY # effectRL :: WrappedNamed rt p wX wY -> RL (PrimOf (WrappedNamed rt p)) wX wY #
(CommuteNoConflicts p, Conflict p) => Conflict (WrappedNamed rt p) # |
Methods resolveConflicts :: WrappedNamed rt p wX wY -> [[Sealed (FL (PrimOf (WrappedNamed rt p)) wY)]] # conflictedEffect :: WrappedNamed rt p wX wY -> [IsConflictedPrim (PrimOf (WrappedNamed rt p))] #
Show2 p => Show1 (WrappedNamed rt p wX) # |
Methods showDict1 :: ShowDict (WrappedNamed rt p wX wX) #
Show2 p => Show (WrappedNamed rt p wX wY) # |
Methods showsPrec :: Int -> WrappedNamed rt p wX wY -> ShowS # show :: WrappedNamed rt p wX wY -> String # showList :: [WrappedNamed rt p wX wY] -> ShowS #
type ApplyState (WrappedNamed rt p) # |
type ApplyState (WrappedNamed rt p) = ApplyState p
type PrimOf (WrappedNamed rt p) # |
type PrimOf (WrappedNamed rt p) = PrimOf p

class (Apply p, Commute p, Invert p) => Patchy p #

Instances

Patchy DummyPatch # |
Apply p => Patchy (RebaseName p) # |
PrimPatch prim => Patchy (RepoPatchV2 prim) # |
(PrimPatchBase p, Apply p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p)), Invert p) => Patchy (RebaseChange p) # |
(PrimPatchBase p, PatchListFormat p, Conflict p, FromPrim p, Effect p, CommuteNoConflicts p, IsHunk p, Patchy p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p))) => Patchy (RebaseSelect p) # |
(Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (PatchInfoAnd rt p) # |

fromPrim :: FromPrim p => PrimOf p wX wY -> p wX wY #

fromPrims :: FromPrims p => FL (PrimOf p) wX wY -> p wX wY #

rmfile :: PrimConstruct prim => FilePath -> prim wX wY #

addfile :: PrimConstruct prim => FilePath -> prim wX wY #

rmdir :: PrimConstruct prim => FilePath -> prim wX wY #

adddir :: PrimConstruct prim => FilePath -> prim wX wY #

move :: PrimConstruct prim => FilePath -> FilePath -> prim wX wY #

hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim wX wY #

tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim wX wY #

namepatch :: String -> String -> String -> [String] -> FL p wX wY -> IO (Named p wX wY) #

anonymous :: FL p wX wY -> IO (Named p wX wY) #

binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim wX wY #

description :: ShowPatch p => p wX wY -> Doc #

showContextPatch :: (ShowPatch p, Monad m, ApplyMonad (ApplyState p) m) => p wX wY -> m Doc #

showContextPatch is used to add context to a patch, as diff -u does. Thus, it differs from showPatch only for hunks. It is used for instance before putting it into a bundle. As this unified context is not included in patch representation, this requires access to the tree.

showPatch :: ShowPatchBasic p => p wX wY -> Doc #

showNicely :: ShowPatch p => p wX wY -> Doc #

infopatch :: PatchInfo -> FL 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 #

primIsAddfile :: PrimClassify prim => prim wX wY -> Bool #

primIsHunk :: PrimClassify prim => prim wX wY -> Bool #

primIsSetpref :: PrimClassify prim => prim wX wY -> Bool #

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 -> [FilePath] #

hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool #

forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString #

forceTokReplace replaces all occurrences of the old token with the new token, throughout the input ByteString.

class (Patchy prim, MyEq prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PatchInspect prim, ReadPatch prim, ShowPatch prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim #

# for PatchTest

resolveConflicts :: Conflict p => p wX wY -> [[Sealed (FL (PrimOf p) wY)]] #

class Effect p where #

Patches whose concrete effect which can be expressed as a list of primitive patches.

A minimal definition would be either of `effect` or `effectRL`.

Minimal complete definition

effect | effectRL

Methods

effect :: p wX wY -> FL (PrimOf p) wX wY #

Instances

Effect DummyPatch # |
Methods effect :: DummyPatch wX wY -> FL (PrimOf DummyPatch) wX wY # effectRL :: DummyPatch wX wY -> RL (PrimOf DummyPatch) wX wY #
Effect p => Effect (RL p) # |
Methods effect :: RL p wX wY -> FL (PrimOf (RL p)) wX wY # effectRL :: RL p wX wY -> RL (PrimOf (RL p)) wX wY #
Effect p => Effect (FL p) # |
Methods effect :: FL p wX wY -> FL (PrimOf (FL p)) wX wY # effectRL :: FL p wX wY -> RL (PrimOf (FL p)) wX wY #
Effect p => Effect (Named p) # |
Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY # effectRL :: Named p wX wY -> RL (PrimOf (Named p)) wX wY #
Effect (RebaseName p) # |
Methods effect :: RebaseName p wX wY -> FL (PrimOf (RebaseName p)) wX wY # effectRL :: RebaseName p wX wY -> RL (PrimOf (RebaseName p)) wX wY #
Effect (RebaseFixup p) # |
Methods effect :: RebaseFixup p wX wY -> FL (PrimOf (RebaseFixup p)) wX wY # effectRL :: RebaseFixup p wX wY -> RL (PrimOf (RebaseFixup p)) wX wY #
Effect (Suspended p) # |
Methods effect :: Suspended p wX wY -> FL (PrimOf (Suspended p)) wX wY # effectRL :: Suspended p wX wY -> RL (PrimOf (Suspended p)) wX wY #
PrimPatch prim => Effect (RepoPatchV2 prim) # |
Methods effect :: RepoPatchV2 prim wX wY -> FL (PrimOf (RepoPatchV2 prim)) wX wY # effectRL :: RepoPatchV2 prim wX wY -> RL (PrimOf (RepoPatchV2 prim)) wX wY #
Effect p => Effect (WithDroppedDeps p) # |
Methods effect :: WithDroppedDeps p wX wY -> FL (PrimOf (WithDroppedDeps p)) wX wY # effectRL :: WithDroppedDeps p wX wY -> RL (PrimOf (WithDroppedDeps p)) wX wY #
(PrimPatchBase p, Invert p, Effect p) => Effect (RebaseChange p) # |
Methods effect :: RebaseChange p wX wY -> FL (PrimOf (RebaseChange p)) wX wY # effectRL :: RebaseChange p wX wY -> RL (PrimOf (RebaseChange p)) wX wY #
(PrimPatchBase p, Invert p, Effect p) => Effect (RebaseSelect p) # |
Methods effect :: RebaseSelect p wX wY -> FL (PrimOf (RebaseSelect p)) wX wY # effectRL :: RebaseSelect p wX wY -> RL (PrimOf (RebaseSelect p)) wX wY #
Effect p => Effect (WrappedNamed rt p) # |
Methods effect :: WrappedNamed rt p wX wY -> FL (PrimOf (WrappedNamed rt p)) wX wY # effectRL :: WrappedNamed rt p wX wY -> RL (PrimOf (WrappedNamed rt p)) wX wY #
Effect p => Effect (PatchInfoAnd rt p) # |
Methods effect :: PatchInfoAnd rt p wX wY -> FL (PrimOf (PatchInfoAnd rt p)) wX wY # effectRL :: PatchInfoAnd rt p wX wY -> RL (PrimOf (PatchInfoAnd rt p)) wX wY #

effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY #

primIsBinary :: PrimClassify prim => prim wX wY -> Bool #

primIsAdddir :: PrimClassify prim => prim wX wY -> Bool #

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

`commuteFL` commutes a single element past a FL.

commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY) #

`commuteFLorComplain` attempts to commute a single element past a FL. If any individual commute fails, then we return the patch that first patch that cannot be commuted past.

commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY) #

`commuteRL` commutes a RL past a single element.

readPatch :: ReadPatch p => ByteString -> Maybe (Sealed (p wX)) #

readPatchPartial :: ReadPatch p => ByteString -> Maybe (Sealed (p wX), ByteString) #

canonize :: PrimCanonize prim => DiffAlgorithm -> prim wX wY -> FL prim wX wY #

It can sometimes be handy to have a canonical representation of a given patch. We achieve this by defining a canonical form for each patch type, and a function `canonize` which takes a patch and puts it into canonical form. This routine is used by the diff function to create an optimal patch (based on an LCS algorithm) from a simple hunk describing the old and new version of a file.

sortCoalesceFL :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY #

`sortCoalesceFL` `ps` coalesces as many patches in `ps` as possible, sorting the results in some standard order.

tryToShrink :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY #

`tryToShrink ps` simplifies `ps` by getting rid of self-cancellations or coalescing patches

Question (Eric Kow): what properties should this have? For example, the prim1 implementation only gets rid of the first self-cancellation it finds (as far as I can tell). Is that OK? Can we try harder?

patchname :: Named p wX wY -> String #

patchcontents :: Named p wX wY -> FL p wX wY #

applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)]) #

apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () #

applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) #

Apply a patch to a `Tree`, yielding a new `Tree`.

maybeApplyToTree :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Tree IO -> IO (Maybe (Tree IO)) #

Attempts to apply a given replace patch to a Tree. If the apply fails (if the file the patch applies to already contains the target token), we return Nothing, otherwise we return the updated Tree.

effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath] #

patch2patchinfo :: Named p wX wY -> PatchInfo #

summary :: ShowPatch p => p wX wY -> Doc #

summaryFL :: ShowPatch p => FL p wX wY -> Doc #

plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e wX wY -> Doc #

xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p wX wY -> Doc #

plainSummaryPrims :: PrimDetails prim => Bool -> [FileName] -> FL prim wX wY -> Doc #

adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY #

getdeps :: Named p wX wY -> [PatchInfo] #

listConflictedFiles :: Conflict p => p wX wY -> [FilePath] #

isInconsistent :: Check p => p wX wY -> Maybe Doc #

# Orphan instances

(Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (Named p) # |
(Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (WrappedNamed rt p) # |