Internals/Patches

We should put any documentation that go into Haddock should do into Haddock. This just serves to provide a sort of high-level overview tying everything together (perhaps this also belongs as documentation for the Darcs.Patch module?).

Darcs patch containers

Darcs 1 patches look like this:

Named patch
|
+-- Patch (Merger, PP, etc)
    |
    +-- Patch (nesting)
    |
    +-- Prim

Darcs 2 patches look like this:

Named patch
|
+-- RealPatch (Conflictor, Duplicate, etc)
    |
    +-- Non
    |   |
    |   +-- RealPatch (nesting)
    |   |
    |   +-- Prim
    |
    +-- Prim

Patch classes

Defined in some submodule of Darcs.Patch:

Class name
Apply Invert Commute Merge Effect Conflict CommuteNoConflicts PatchInspect ShowPatchBasic ShowContextPatch ShowPatch IsHunk ReadPatch PatchListFormat Nonable Annotate ApplyState FromPrim PrimPatchBase Check Repair RepairToFL RepairInternal RepairInternalFL PatchDebug

Empty subclasses:

Matchable:

class (Apply p, Commute p, Invert p, PatchInspect p)
    => Matchable p

RepoPatch:

class (Apply p, Commute p, Invert p, Merge p, Effect p, IsHunk p,
       PatchInspect p, ReadPatch p, ShowPatch p, ShowContextPatch p,
       FromPrim p, Conflict p, CommuteNoConflicts p,
       Check p, RepairToFL p, PatchListFormat p,
       PrimPatchBase p, IsHunk (PrimOf p),
       Matchable p, Annotate p, ApplyState p ~ ApplyState (PrimOf p)
      )
    => RepoPatch p

See also