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

Safe HaskellNone




class Commute p where

Commute represents things that can be (possibly) commuted.


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

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

commuteFL commutes a single element past a FL.

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

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)

commuteRL commutes a RL past a single element.

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

commuteRLFL commutes an RL past an FL.

selfCommuter :: Commute p => CommuteFn p p

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