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

Safe Haskell | None

Darcs.Patch.Commute

Synopsis

- class Commute p where
  - commute :: (p :> p) x y -> Maybe ((p :> p) x y)
- commuteFL :: Commute p => (p :> FL p) x y -> Maybe ((FL p :> p) x y)
- commuteFLorComplain :: Commute p => (p :> FL p) x y -> Either (Sealed2 p) ((FL p :> p) x y)
- commuteRL :: Commute p => (RL p :> p) x y -> Maybe ((p :> RL p) x y)
- commuteRLFL :: Commute p => (RL p :> FL p) x y -> Maybe ((FL p :> RL p) x y)
- toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) x y -> m ((q :< p) x y)) -> (q :> p) x y -> m ((p :> q) x y)
- toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) x y -> m ((q :> p) x y)) -> (q :< p) x y -> m ((p :< q) x y)

# Documentation

class Commute p where

Things that can commute.

Methods

commute :: (p :> p) x y -> Maybe ((p :> p) x y)

Instances

Commute Prim |
Commute Prim |
Commute DummyPatch |
Commute p => Commute (RL p) |
Commute p => Commute (FL p) |
PrimPatch prim => Commute (Patch prim) |
Commute p => Commute (Named p) |
Commute p => Commute (PatchInfoAnd p) |
Commute p => Commute (PatchChoice p) |
Commute p => Commute (TaggedPatch p) |
PrimPatch prim => Commute (RealPatch prim) |

commuteFL :: Commute p => (p :> FL p) x y -> Maybe ((FL p :> p) x y)

commuteFLorComplain :: Commute p => (p :> FL p) x y -> Either (Sealed2 p) ((FL p :> p) x y)

commuteRL :: Commute p => (RL p :> p) x y -> Maybe ((p :> RL p) x y)

commuteRLFL :: Commute p => (RL p :> FL p) x y -> Maybe ((FL p :> RL p) x y)

toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) x y -> m ((q :< p) x y)) -> (q :> p) x y -> m ((p :> q) x y)

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

toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) x y -> m ((q :> p) x y)) -> (q :< p) x y -> m ((p :< q) x y)

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