ContentsIndex
Darcs.Patch.Choices
Description

PatchChoices divides a sequence of patches into three sets: first, middle and last, such that all patches can be applied, if you first apply the first ones then the middle ones and then the last ones. Obviously if there are dependencies between the patches that will put a constraint on how you can choose to divide them up. The PatchChoices data type and associated functions are here to deal with many of the common cases that come up when choosing a subset of a group of patches.

force_last tells PatchChoices that a particular patch is required to be in the last group, which also means that any patches that depend on it must be in the last group.

Internally, a PatchChoices doesn't actually reorder the patches until it is asked for the final output (e.g. by get_first_choice). Instead, each patch is placed in a state of definitely first, definitely last and undecided; undecided leans towards middle. In case you're wondering about the first-middle-last language, it's because in some cases the yes answers will be last (as is the case for the revert command), and in others first (as in record, pull and push).

Documentation
newtype Tag
Constructors
TG Integer
show/hide Instances
Enum Tag
Eq Tag
Num Tag
Ord Tag
Show Tag
data TaggedPatch p
Constructors
TP Tag p
show/hide Instances
data PatchChoice p
Constructors
PC (TaggedPatch p) Slot
show/hide Instances
newtype PatchChoices p
Constructors
PCs (FL (PatchChoice p))
data Slot
Constructors
InFirst
InMiddle
InLast
invertTag :: Slot -> Slot
tag :: TaggedPatch p -> Tag
tp_patch :: TaggedPatch p -> p
liftTP :: (p -> p) -> TaggedPatch p -> TaggedPatch p
patch_choices :: Patchy p => FL p -> PatchChoices p
patch_choices_tps :: Patchy p => FL p -> (PatchChoices p, FL (TaggedPatch p))
make_everything_later :: Patchy p => PatchChoices p -> PatchChoices p
invertSeq :: (Invert p, Invert q) => (p :> q) -> q :> p
separate_first_from_middle_last :: Patchy p => PatchChoices p -> FL (TaggedPatch p) :> FL (TaggedPatch p)
separate_first_middle_from_last :: Patchy p => PatchChoices p -> FL (TaggedPatch p) :> FL (TaggedPatch p)
get_choices :: Patchy p => PatchChoices p -> FL (TaggedPatch p) :> (FL (TaggedPatch p) :> FL (TaggedPatch p))
pull_firsts_middles :: Patchy p => FL (PatchChoice p) -> FL (TaggedPatch p) :> FL (TaggedPatch p)
pull_only_firsts :: Patchy p => FL (PatchChoice p) -> FL (TaggedPatch p) :> FL (TaggedPatch p)
pull_firsts :: Patchy p => FL (PatchChoice p) -> FL (TaggedPatch p) :> FL (PatchChoice p)
pull_lasts :: Patchy p => FL (PatchChoice p) -> FL (PatchChoice p) :> FL (TaggedPatch p)
pull_first :: Patchy p => FL (PatchChoice p) -> Maybe (TaggedPatch p :> FL (PatchChoice p))
patch_slot :: forall p. TaggedPatch p -> PatchChoices p -> Slot
set_simplys :: [Tag] -> Bool -> FL (PatchChoice p) -> FL (PatchChoice p)
m2ids :: (TaggedPatch p -> Bool) -> FL (PatchChoice p) -> [Tag]
force_matching_first :: Patchy p => (TaggedPatch p -> Bool) -> PatchChoices p -> PatchChoices p
force_firsts :: Patchy p => [Tag] -> PatchChoices p -> PatchChoices p
force_first :: Patchy p => Tag -> PatchChoices p -> PatchChoices p
select_all_middles :: Patchy p => Bool -> PatchChoices p -> PatchChoices p
reverse_pc :: Patchy p => PatchChoices p -> PatchChoices p
force_matching_last :: Patchy p => (TaggedPatch p -> Bool) -> PatchChoices p -> PatchChoices p
force_last :: Patchy p => Tag -> PatchChoices p -> PatchChoices p
force_lasts :: Patchy p => [Tag] -> PatchChoices p -> PatchChoices p
make_uncertain :: Patchy p => Tag -> PatchChoices p -> PatchChoices p
Produced by Haddock version 2.4.2