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

Darcs.Patch.Commute

Synopsis

Documentation

class Commute p where Source #

Commute represents things that can be (possibly) commuted.

Instances should obey the following laws:

  • Symmetry
commute (p:>q) == Just (q':>p') <=> commute (q':>p') == Just (p':>q)
  • If an instance Invert p exists, then
commute (p:>q) == Just (q':>p') <=> commute (invert q:>invert p) == Just (invert p':>invert q')
  • The more general Square-Commute law
commute (p:>q) == Just (q':>p') => commute (invert p:>q') == Just (q:>invert p')

is required to hold only for primitive patches, i.e. if there is no instance Merge p, because together with merge it implies that any two patches commute.

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.V1.Commute

Methods

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

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 RebaseName Source # 
Instance details

Defined in Darcs.Patch.Rebase.Name

Commute Prim Source # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

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

Commute Prim Source # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

commute :: (Prim :> Prim) wX wY -> Maybe ((Prim :> Prim) 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 #

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 (LabelledPatch p) Source # 
Instance details

Defined in Darcs.Patch.Choices

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 (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 #

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 #

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 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 #

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

Defined in Darcs.Patch.PatchInfoAnd

Methods

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

Commute p => Commute (WrappedNamed rt p) Source # 
Instance details

Defined in Darcs.Patch.Named.Wrapped

Methods

commute :: (WrappedNamed rt p :> WrappedNamed rt p) wX wY -> Maybe ((WrappedNamed rt p :> WrappedNamed rt 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.