darcs-2.18.3: a distributed, interactive, smart revision control system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Patch.Commute

Synopsis

Documentation

class Commute p where Source #

Class of patches that that can be commuted.

Instances should obey the following laws:

commute-symmetry
commute (p:>q) == Just (q':>p') <=> commute (q':>p') == Just (p':>q)
invert-commute

If patches are invertible, then

commute (p:>q) == Just (q':>p') <=> commute (invert q:>invert p) == Just (invert p':>invert q')

The more general law

square-commute
commute (p:>q) == Just (q':>p') => commute (invert p:>q') == Just (q:>invert p')

is valid in general only provided we know (a priori) that commute (invert p:>q') succeeds, in other words, that p and q are not in conflict with each other. See Darcs.Patch.CommuteNoConflicts for an extended discussion.

Methods

commute :: (p :> p) wX wY -> Maybe ((p :> p) wX wY) Source #

Instances

Instances details
Commute Prim Source # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Commute

Methods

commute :: (Prim :> Prim) wX wY -> Maybe ((Prim :> Prim) wX wY) Source #

Commute Prim Source # 
Instance details

Defined in Darcs.Patch.Prim.V1.Commute

Methods

commute :: (Prim :> Prim) wX wY -> Maybe ((Prim :> Prim) wX wY) Source #

Commute RebaseName Source # 
Instance details

Defined in Darcs.Patch.Rebase.Name

Commute Prim Source # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

commute :: (Prim :> Prim) wX wY -> Maybe ((Prim :> Prim) wX wY) Source #

Commute Prim Source # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

commute :: (Prim :> Prim) wX wY -> Maybe ((Prim :> Prim) wX wY) Source #

Commute p => Commute (LabelledPatch p) Source # 
Instance details

Defined in Darcs.Patch.Choices

Commute p => Commute (Invertible p) Source # 
Instance details

Defined in Darcs.Patch.Invertible

Methods

commute :: (Invertible p :> Invertible p) wX wY -> Maybe ((Invertible p :> Invertible p) wX wY) Source #

Commute p => Commute (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

commute :: (Named p :> Named p) wX wY -> Maybe ((Named p :> Named p) wX wY) Source #

(PatchId p ~ PatchInfo, Commute p) => Commute (PatchInfoAndG p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

Commute prim => Commute (RebaseChange prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Change

Methods

commute :: (RebaseChange prim :> RebaseChange prim) wX wY -> Maybe ((RebaseChange prim :> RebaseChange prim) wX wY) Source #

Commute prim => Commute (RebaseFixup prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Fixup

Methods

commute :: (RebaseFixup prim :> RebaseFixup prim) wX wY -> Maybe ((RebaseFixup prim :> RebaseFixup prim) wX wY) Source #

PrimPatch prim => Commute (RepoPatchV1 prim) Source # 
Instance details

Defined in Darcs.Patch.V1.Commute

Methods

commute :: (RepoPatchV1 prim :> RepoPatchV1 prim) wX wY -> Maybe ((RepoPatchV1 prim :> RepoPatchV1 prim) wX wY) Source #

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

Defined in Darcs.Patch.V2.RepoPatch

Methods

commute :: (RepoPatchV2 prim :> RepoPatchV2 prim) wX wY -> Maybe ((RepoPatchV2 prim :> RepoPatchV2 prim) wX wY) Source #

Commute p => Commute (FL p) Source # 
Instance details

Defined in Darcs.Patch.Commute

Methods

commute :: (FL p :> FL p) wX wY -> Maybe ((FL p :> FL p) wX wY) Source #

Commute p => Commute (RL p) Source # 
Instance details

Defined in Darcs.Patch.Commute

Methods

commute :: (RL p :> RL p) wX wY -> Maybe ((RL p :> RL p) wX wY) Source #

(SignedId name, Commute p) => Commute (PrimWithName name p) Source # 
Instance details

Defined in Darcs.Patch.Prim.WithName

Methods

commute :: (PrimWithName name p :> PrimWithName name p) wX wY -> Maybe ((PrimWithName name p :> PrimWithName name p) wX wY) Source #

(SignedId name, StorableId name, PrimPatch prim) => Commute (RepoPatchV3 name prim) Source # 
Instance details

Defined in Darcs.Patch.V3.Core

Methods

commute :: (RepoPatchV3 name prim :> RepoPatchV3 name prim) wX wY -> Maybe ((RepoPatchV3 name prim :> RepoPatchV3 name prim) wX wY) Source #

commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) Source #

commuteFL commutes a single element past a FL.

commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY) Source #

commuteRL commutes a RL past a single element.

commuteRLFL :: Commute p => (RL p :> FL p) wX wY -> Maybe ((FL p :> RL p) wX wY) Source #

commuteRLFL commutes an RL past an FL.

selfCommuter :: Commute p => CommuteFn p p Source #

Build a commuter between a patch and itself using the operation from the type class.