darcs-2.10.1: 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.

Methods

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

commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY) Source

commuteFLorComplain attempts to commute a single element past a FL. If any individual commute fails, then we return the patch that first patch that cannot be commuted past.

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.

toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) wX wY -> m ((q :< p) wX wY)) -> (q :> p) wX wY -> m ((p :> q) wX wY) Source

Swaps the ordered pair type so that commute can be called directly.

toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) wX wY -> m ((q :> p) wX wY)) -> (q :< p) wX wY -> m ((p :< q) wX wY) Source

Swaps the ordered pair type from the order expected by commute to the reverse order.

selfCommuter :: Commute p => CommuteFn p p Source

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