darcs

Safe Haskell | Safe-Infered

Darcs.Patch.Prim.V1.Core

Synopsis

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

# Documentation

data Prim where

Constructors

Move :: !FileName -> !FileName -> Prim |
DP :: !FileName -> !DirPatchType -> Prim |
FP :: !FileName -> !FilePatchType -> Prim |
ChangePref :: !String -> !String -> !String -> Prim |

Instances

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

data DirPatchType

Constructors

RmDir |
AddDir |

Instances

Eq DirPatchType |
Ord DirPatchType |
Show DirPatchType |
MyEq DirPatchType |

data FilePatchType

Constructors

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

Instances

Eq FilePatchType |
Ord FilePatchType |
Show FilePatchType |
MyEq FilePatchType |

isIdentity :: Prim -> EqCheck

comparePrim :: Prim -> Prim -> 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.