darcs-2.16.4: a distributed, interactive, smart revision control system
Safe HaskellNone
LanguageHaskell2010

Darcs.Patch.Unwind

Synopsis

Documentation

class Unwind p where Source #

Methods

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

Instances details
PrimPatch prim => Unwind (RepoPatchV1 prim) Source # 
Instance details

Defined in Darcs.Patch.V1.Commute

Methods

fullUnwind :: RepoPatchV1 prim wX wY -> Unwound (PrimOf (RepoPatchV1 prim)) wX wY Source #

PrimPatch prim => Unwind (RepoPatchV2 prim) Source # 
Instance details

Defined in Darcs.Patch.V2.RepoPatch

Methods

fullUnwind :: RepoPatchV2 prim wX wY -> Unwound (PrimOf (RepoPatchV2 prim)) wX wY Source #

(PrimPatchBase p, Unwind p) => Unwind (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

fullUnwind :: Named p wX wY -> Unwound (PrimOf (Named p)) wX wY Source #

(Invert prim, Commute prim, Eq2 prim) => Unwind (RepoPatchV3 name prim) Source # 
Instance details

Defined in Darcs.Patch.V3.Core

Methods

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.

Constructors

Unwound 

Fields

  • :: FL prim wA wB

    context before

  • -> FL prim wB wC

    underlying primitives

  • -> RL prim wC wD

    context after

  • -> Unwound prim wA wD
     

Instances

Instances details
Show2 prim => Show2 (Unwound prim) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

showDict2 :: ShowDict (Unwound prim wX wY) Source #

Invert prim => Invert (Unwound prim) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

invert :: Unwound prim wX wY -> Unwound prim wY wX Source #

(PatchListFormat prim, ShowPatchBasic prim) => ShowPatchBasic (Unwound prim) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

showPatch :: ShowPatchFor -> Unwound prim wX wY -> Doc Source #

Show2 prim => Show1 (Unwound prim wX) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

showDict1 :: Dict (Show (Unwound prim wX wX0)) Source #

Show2 prim => Show (Unwound prim wX wY) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

showsPrec :: Int -> Unwound prim wX wY -> ShowS #

show :: Unwound prim wX wY -> String #

showList :: [Unwound prim wX wY] -> ShowS #

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.