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

Safe Haskell | None

Darcs.Patch.Prim.V1.Core

Synopsis

- data Prim x y where
  - Move :: !FileName -> !FileName -> Prim x y
  - DP :: !FileName -> !(DirPatchType x y) -> Prim x y
  - FP :: !FileName -> !(FilePatchType x y) -> Prim x y
  - ChangePref :: !String -> !String -> !String -> Prim x y
- data DirPatchType x y
  - = RmDir
  - | AddDir
- data FilePatchType x y
  - = RmFile
  - | AddFile
  - | Hunk !Int [ByteString] [ByteString]
  - | TokReplace !String !String !String
  - | Binary ByteString ByteString
- isIdentity :: Prim x y -> EqCheck x y
- comparePrim :: Prim x y -> Prim w z -> Ordering

# Documentation

data Prim x y where

Constructors

Move :: !FileName -> !FileName -> Prim x y |
DP :: !FileName -> !(DirPatchType x y) -> Prim x y |
FP :: !FileName -> !(FilePatchType x y) -> Prim x y |
ChangePref :: !String -> !String -> !String -> Prim x y |

Instances

Show2 Prim |
PatchListFormat Prim |
MyEq Prim |
Commute Prim |
Invert Prim |
PatchInspect Prim |
ReadPatch Prim |
Apply Prim |
RepairToFL Prim |
~ ((* -> *) -> *) (ApplyState Prim) Tree => ShowPatch Prim |
ShowPatchBasic Prim |
Patchy Prim |
IsHunk Prim |
PrimApply Prim |
PrimRead Prim |
PrimShow Prim |
PrimDetails Prim |
PrimCanonize Prim |
PrimConstruct Prim |
PrimClassify Prim |
FromPrim Prim |
PrimPatchBase Prim |
PrimPatch Prim |
Show1 (Prim x) |
Eq (Prim x y) |
Show (Prim x y) |

data DirPatchType x y

Constructors

RmDir |
AddDir |

Instances

MyEq DirPatchType |
Eq (DirPatchType x y) |
Ord (DirPatchType x y) |
Show (DirPatchType x y) |

data FilePatchType x y

Constructors

RmFile |
AddFile |
Hunk !Int [ByteString] [ByteString] |
TokReplace !String !String !String |
Binary ByteString ByteString |

Instances

MyEq FilePatchType |
Eq (FilePatchType x y) |
Ord (FilePatchType x y) |
Show (FilePatchType x y) |

isIdentity :: Prim x y -> EqCheck x y

comparePrim :: Prim x y -> Prim w z -> Ordering

`comparePrim` `p1 p2` is used to provide an arbitrary ordering between `p1` and `p2`. Basically, identical patches are equal and `Move < DP < FP < ChangePref`. Everything else is compared in dictionary order of its arguments.