- showPrim :: PrimShow prim => FileNameFormat -> prim a b -> Doc
- showPrimFL :: PrimShow prim => FileNameFormat -> FL prim a b -> Doc
- adddir :: PrimConstruct prim => FilePath -> prim x y
- addfile :: PrimConstruct prim => FilePath -> prim x y
- binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim x y
- changepref :: PrimConstruct prim => String -> String -> String -> prim x y
- hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim x y
- move :: PrimConstruct prim => FilePath -> FilePath -> prim x y
- rmdir :: PrimConstruct prim => FilePath -> prim x y
- rmfile :: PrimConstruct prim => FilePath -> prim x y
- tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim x y
- primFromHunk :: PrimConstruct prim => FileHunk x y -> prim x y
- primIsAddfile :: PrimClassify prim => prim x y -> Bool
- primIsHunk :: PrimClassify prim => prim x y -> Bool
- primIsBinary :: PrimClassify prim => prim x y -> Bool
- primIsSetpref :: PrimClassify prim => prim x y -> Bool
- primIsAdddir :: PrimClassify prim => prim x y -> Bool
- is_filepatch :: PrimClassify prim => prim x y -> Maybe FileName
- canonize :: PrimCanonize prim => prim x y -> FL prim x y
- tryToShrink :: PrimCanonize prim => FL prim x y -> FL prim x y
- sortCoalesceFL :: PrimCanonize prim => FL prim x y -> FL prim x y
- join :: PrimCanonize prim => (prim :> prim) x y -> Maybe (FL prim x y)
- canonizeFL :: PrimCanonize prim => FL prim x y -> FL prim x y
- tryShrinkingInverse :: PrimCanonize prim => FL prim x y -> Maybe (FL prim x y)
- summarizePrim :: PrimDetails prim => prim x y -> [SummDetail]
- applyPrimFL :: (PrimApply prim, ApplyMonad m) => FL prim x y -> m ()
- readPrim :: (PrimRead prim, ParserM m) => FileNameFormat -> m (Sealed (prim x))
- class FromPrim p where
- class FromPrims p where
- fromPrims :: FL (PrimOf p) x y -> p x y
- joinPatches :: FL p x y -> p x y
- class FromPrim p => ToFromPrim p where
- class (Patchy prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim
- class PrimPatch (PrimOf p) => PrimPatchBase p where
- type PrimOf p :: * -> * -> *
Documentation
showPrim :: PrimShow prim => FileNameFormat -> prim a b -> DocSource
showPrimFL :: PrimShow prim => FileNameFormat -> FL prim a b -> DocSource
adddir :: PrimConstruct prim => FilePath -> prim x ySource
addfile :: PrimConstruct prim => FilePath -> prim x ySource
binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim x ySource
changepref :: PrimConstruct prim => String -> String -> String -> prim x ySource
hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim x ySource
move :: PrimConstruct prim => FilePath -> FilePath -> prim x ySource
rmdir :: PrimConstruct prim => FilePath -> prim x ySource
rmfile :: PrimConstruct prim => FilePath -> prim x ySource
tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim x ySource
primFromHunk :: PrimConstruct prim => FileHunk x y -> prim x ySource
primIsAddfile :: PrimClassify prim => prim x y -> BoolSource
primIsHunk :: PrimClassify prim => prim x y -> BoolSource
primIsBinary :: PrimClassify prim => prim x y -> BoolSource
primIsSetpref :: PrimClassify prim => prim x y -> BoolSource
primIsAdddir :: PrimClassify prim => prim x y -> BoolSource
is_filepatch :: PrimClassify prim => prim x y -> Maybe FileNameSource
canonize :: PrimCanonize prim => prim x y -> FL prim x ySource
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.
tryToShrink :: PrimCanonize prim => FL prim x y -> FL prim x ySource
sortCoalesceFL :: PrimCanonize prim => FL prim x y -> FL prim x ySource
sortCoalesceFL
ps
coalesces as many patches in ps
as
possible, sorting the results in some standard order.
canonizeFL :: PrimCanonize prim => FL prim x y -> FL prim x ySource
canonizeFL
ps
puts 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.
Note that this process does not preserve the commutation behaviour of the patches and is therefore not appropriate for use when working with already recorded patches (unless doing amend-record or the like).
tryShrinkingInverse :: PrimCanonize prim => FL prim x y -> Maybe (FL prim x y)Source
summarizePrim :: PrimDetails prim => prim x y -> [SummDetail]Source
applyPrimFL :: (PrimApply prim, ApplyMonad m) => FL prim x y -> m ()Source
class FromPrim p => ToFromPrim p whereSource
ToFromPrim (RealPatch prim) |
class (Patchy prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim Source
class PrimPatch (PrimOf p) => PrimPatchBase p Source
PrimPatchBase p => PrimPatchBase (RL p) | |
PrimPatchBase p => PrimPatchBase (FL p) | |
PrimPatch prim => PrimPatchBase (Patch prim) | |
PrimPatchBase p => PrimPatchBase (Named p) | |
PrimPatchBase p => PrimPatchBase (PatchInfoAnd p) | |
PrimPatch prim => PrimPatchBase (RealPatch prim) |