Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class Commute p where Source #
Class of patches that that can be commuted.
Instances should obey the following laws:
- commute-symmetry
commute (p:>q) == Just (q':>p') <=> commute (q':>p') == Just (p':>q)
- invert-commute
If patches are invertible, then
commute (p:>q) == Just (q':>p') <=> commute (invert q:>invert p) == Just (invert p':>invert q')
The more general law
- square-commute
commute (p:>q) == Just (q':>p') => commute (invert p:>q') == Just (q:>invert p')
is valid in general only provided we know (a priori) that
succeeds, in other words, that p and q are not in conflict with each
other. See Darcs.Patch.CommuteNoConflicts for an extended discussion.commute
(invert
p:>
q')
Instances
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.