Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
class Commute p where Source #
Commute represents things that can be (possibly) commuted.
Instances should obey the following laws:
- Symmetry
commute (p:>q) == Just (q':>p') <=> commute (q':>p') == Just (p':>q)
- If an instance
exists, thenInvert
p
commute (p:>q) == Just (q':>p') <=> commute (invert q:>invert p) == Just (invert p':>invert q')
- The more general Square-Commute law
commute (p:>q) == Just (q':>p') => commute (invert p:>q') == Just (q:>invert p')
is required to hold only for primitive patches, i.e. if there is no
instance
, because together with Merge
pmerge
it implies that
any two patches commute.
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.