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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Prim.Canonize

Synopsis

- canonizeFL :: forall (prim :: Type -> Type -> Type) wX wY. (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY

# Documentation

canonizeFL :: forall (prim :: Type -> Type -> Type) wX wY. (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY #

Put 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.

XXX Why not? How does it differ? The implementation for Prim.V1 does sortCoalesceFL and then invokes the diff algorithm for each hunk. How can that be any different to applying the sequence and then taking the diff? Is this merely because diff does not sort by file path?

Besides, diff and apply must be inverses in the sense that for any two states {start, end}, we have

    diff start (apply (diff start end)) == end