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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Unwind

Synopsis

- class Unwind (p :: Type -> Type -> Type) where
  - fullUnwind :: p wX wY -> Unwound (PrimOf p) wX wY
- data Unwound (prim :: Type -> Type -> Type) wX wY where
  - Unwound :: forall (prim :: Type -> Type -> Type) wX wB wC wY. FL prim wX wB -> FL prim wB wC -> RL prim wC wY -> Unwound prim wX wY
- mkUnwound :: forall (prim :: Type -> Type -> Type) wA wB wC wD. (Commute prim, Invert prim, Eq2 prim) => FL prim wA wB -> FL prim wB wC -> FL prim wC wD -> Unwound prim wA wD
- squashUnwound :: forall (prim :: Type -> Type -> Type) wX wY. (Show2 prim, Commute prim, Eq2 prim, Invert prim) => FL (Unwound prim) wX wY -> Unwound prim wX wY

# Documentation

class Unwind (p :: Type -> Type -> Type) where #

Methods

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

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

(PrimPatchBase p, Unwind p) => Unwind (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods fullUnwind :: Named p wX wY -> Unwound (PrimOf (Named p)) wX wY #
PrimPatch prim => Unwind (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Commute Methods fullUnwind :: RepoPatchV1 prim wX wY -> Unwound (PrimOf (RepoPatchV1 prim)) wX wY #
PrimPatch prim => Unwind (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch Methods fullUnwind :: RepoPatchV2 prim wX wY -> Unwound (PrimOf (RepoPatchV2 prim)) wX wY #
(Invert prim, Commute prim, Eq2 prim) => Unwind (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Methods fullUnwind :: RepoPatchV3 name prim wX wY -> Unwound (PrimOf (RepoPatchV3 name prim)) wX wY #

data Unwound (prim :: Type -> Type -> Type) wX wY where #

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 :: forall (prim :: Type -> Type -> Type) wX wB wC wY. FL prim wX wB context before -> FL prim wB wC underlying primitives -> RL prim wC wY context after -> Unwound prim wX wY

#### Instances

Instances details

Invert prim => Invert (Unwound prim) # |
Instance details Defined in Darcs.Patch.Unwind Methods invert :: Unwound prim wX wY -> Unwound prim wY wX #
(PatchListFormat prim, ShowPatchBasic prim) => ShowPatchBasic (Unwound prim) # |
Instance details Defined in Darcs.Patch.Unwind Methods showPatch :: ShowPatchFor -> Unwound prim wX wY -> Doc #
Show2 prim => Show2 (Unwound prim) # |
Instance details Defined in Darcs.Patch.Unwind Methods showDict2 :: ShowDict (Unwound prim wX wY) #
Show2 prim => Show1 (Unwound prim wX) # |
Instance details Defined in Darcs.Patch.Unwind Methods showDict1 :: Dict (Show (Unwound prim wX wX0)) #
Show2 prim => Show (Unwound prim wX wY) # |
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 :: forall (prim :: Type -> Type -> Type) wA wB wC wD. (Commute prim, Invert prim, Eq2 prim) => FL prim wA wB -> FL prim wB wC -> FL prim wC wD -> Unwound prim wA wD #

squashUnwound :: forall (prim :: Type -> Type -> Type) wX wY. (Show2 prim, Commute prim, Eq2 prim, Invert prim) => FL (Unwound prim) wX wY -> Unwound prim wX wY #

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