darcs

Safe Haskell | Safe-Infered

Darcs.Patch.Commute

Synopsis

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

# Documentation

class Commute p where

Things that can commute.

Methods

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

Instances

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) -> Maybe (FL p :> p)

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

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

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

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

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

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

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