ContentsIndex
Darcs.Patch.Permutations
Synopsis
partitionFL :: Commute p => (p -> Bool) -> FL p -> FL p :> FL p
partitionFL' :: Commute p => (p -> Bool) -> RL p -> FL p -> FL p :> FL p
partitionRL :: Commute p => (p -> Bool) -> RL p -> RL p :> RL p
partitionRL' :: Commute p => (p -> Bool) -> RL p -> FL p -> RL p :> RL p
commuteWhatWeCanFL :: Commute p => (p :> FL p) -> FL p :> (p :> FL p)
commuteWhatWeCanRL :: Commute p => (RL p :> p) -> RL p :> (p :> RL p)
genCommuteWhatWeCanRL :: ((p :> p) -> Maybe (p :> p)) -> (RL p :> p) -> RL p :> (p :> RL p)
removeCommon :: (MyEq p, Commute p) => (FL p :\/: FL p) -> FL p :\/: FL p
removeFL :: (MyEq p, Commute p) => p -> FL p -> Maybe (FL p)
removeRL :: (MyEq p, Commute p) => p -> RL p -> Maybe (RL p)
remove_subsequenceFL :: (MyEq p, Commute p) => FL p -> FL p -> Maybe (FL p)
remove_subsequenceRL :: (MyEq p, Commute p) => RL p -> RL p -> Maybe (RL p)
head_permutationsFL :: Commute p => FL p -> [FL p]
headPermutationsFL :: Commute p => FL p -> [p :> FL p]
head_permutationsRL :: Commute p => RL p -> [RL p]
Documentation
partitionFL
:: Commute p
=> p -> Boolpredicate; if true we would like the patch in the left list
-> FL pinput FL
-> FL p :> FL pleft and right results
split an FL into left and right lists according to a predicate, using commutation as necessary. If a patch does satisfy the predicate but cannot be commuted past one that does not satisfy the predicate, it goes in the right list.
partitionFL' :: Commute p => (p -> Bool) -> RL p -> FL p -> FL p :> FL p
partitionRL
:: Commute p
=> p -> Boolpredicate; if true we would like the patch in the right list
-> RL pinput RL
-> RL p :> RL pleft and right results
split an RL into left and right lists according to a predicate, using commutation as necessary. If a patch does satisfy the predicate but cannot be commuted past one that does not satisfy the predicate, it goes in the left list.
partitionRL' :: Commute p => (p -> Bool) -> RL p -> FL p -> RL p :> RL p
commuteWhatWeCanFL :: Commute p => (p :> FL p) -> FL p :> (p :> FL p)
commuteWhatWeCanRL :: Commute p => (RL p :> p) -> RL p :> (p :> RL p)
genCommuteWhatWeCanRL :: ((p :> p) -> Maybe (p :> p)) -> (RL p :> p) -> RL p :> (p :> RL p)
removeCommon :: (MyEq p, Commute p) => (FL p :\/: FL p) -> FL p :\/: FL p
removeFL :: (MyEq p, Commute p) => p -> FL p -> Maybe (FL p)
removeFL x xs removes x from xs if x can be commuted to its head. Otherwise it returns Nothing
removeRL :: (MyEq p, Commute p) => p -> RL p -> Maybe (RL p)
removeRL is like removeFL except with RL
remove_subsequenceFL :: (MyEq p, Commute p) => FL p -> FL p -> Maybe (FL p)
remove_subsequenceFL ab abc returns Just c' where all the patches in ab have been commuted out of it, if possible. If this is not possible for any reason (the set of patches ab is not actually a subset of abc, or they can't be commuted out) we return Nothing.
remove_subsequenceRL :: (MyEq p, Commute p) => RL p -> RL p -> Maybe (RL p)
remove_subsequenceRL is like remove_subsequenceFL except that it works on RL
head_permutationsFL :: Commute p => FL p -> [FL p]
This is a minor variant of headPermutationsFL with each permutation is simply returned as a FL
headPermutationsFL :: Commute p => FL p -> [p :> FL p]

headPermutationsFL p:>:ps returns all the permutations of the list in which one element of ps is commuted past p

Suppose we have a sequence of patches

  X h a y s-t-c k

Suppose furthermore that the patch c depends on t, which in turn depends on s. This function will return

 X :> h a y s t c k
 h :> X a y s t c k
 a :> X h y s t c k
 y :> X h a s t c k
 s :> X h a y t c k
 k :> X h a y s t c
head_permutationsRL :: Commute p => RL p -> [RL p]
head_permutationsRL is like headPermutationsFL, except that we operate on an RL (in other words, we are pushing things to the end of a patch sequence instead of to the beginning).
Produced by Haddock version 2.4.2