Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Unwind p where
- fullUnwind :: p wX wY -> Unwound (PrimOf p) wX wY
- data Unwound prim wX wY where
- mkUnwound :: (Commute prim, Invert prim, Eq2 prim) => FL prim wA wB -> FL prim wB wC -> FL prim wC wD -> Unwound prim wA wD
- squashUnwound :: (Show2 prim, Commute prim, Eq2 prim, Invert prim) => FL (Unwound prim) wX wY -> Unwound prim wX wY
Documentation
fullUnwind :: p wX wY -> Unwound (PrimOf p) wX wY Source #
Get hold of the underlying primitives for a given patch, placed in the context of the patch. If there are conflicts then context patches will be needed.
Instances
PrimPatch prim => Unwind (RepoPatchV1 prim) Source # | |
Defined in Darcs.Patch.V1.Commute fullUnwind :: RepoPatchV1 prim wX wY -> Unwound (PrimOf (RepoPatchV1 prim)) wX wY Source # | |
PrimPatch prim => Unwind (RepoPatchV2 prim) Source # | |
Defined in Darcs.Patch.V2.RepoPatch fullUnwind :: RepoPatchV2 prim wX wY -> Unwound (PrimOf (RepoPatchV2 prim)) wX wY Source # | |
(PrimPatchBase p, Unwind p) => Unwind (Named p) Source # | |
Defined in Darcs.Patch.Named | |
(Invert prim, Commute prim, Eq2 prim) => Unwind (RepoPatchV3 name prim) Source # | |
Defined in Darcs.Patch.V3.Core fullUnwind :: RepoPatchV3 name prim wX wY -> Unwound (PrimOf (RepoPatchV3 name prim)) wX wY Source # |
data Unwound prim wX wY where Source #
An Unwound
represents a primitive patch, together with any
other primitives that are required to place the primitive in a
different context. Typically, the presence of context patches
indicates that the underlying primitive would be in conflict in
the given context.
We have the following invariants: - if a context contains a patch, that context does not also contain the inverse of that patch (when commuted next to each other) - if either context contains a patch that commutes with the underlying patch, then neither context contains the inverse of that patch (when commuted next to each other) Another way of putting it is that all possible pairs of patch+inverse that can be reached by commutation are removed.
Instances
Show2 prim => Show2 (Unwound prim) Source # | |
Defined in Darcs.Patch.Unwind | |
Invert prim => Invert (Unwound prim) Source # | |
(PatchListFormat prim, ShowPatchBasic prim) => ShowPatchBasic (Unwound prim) Source # | |
Defined in Darcs.Patch.Unwind | |
Show2 prim => Show1 (Unwound prim wX) Source # | |
Show2 prim => Show (Unwound prim wX wY) Source # | |
mkUnwound :: (Commute prim, Invert prim, Eq2 prim) => FL prim wA wB -> FL prim wB wC -> FL prim wC wD -> Unwound prim wA wD Source #
squashUnwound :: (Show2 prim, Commute prim, Eq2 prim, Invert prim) => FL (Unwound prim) wX wY -> Unwound prim wX wY Source #
Given a list of unwound patches, use commutation and cancellation of
inverses to remove intermediate contexts. This is not guaranteed to be
possible in general, but should be possible if the patches that were
unwound were all originally recorded (unconflicted) in the same context,
e.g. as part of the same Named
.