Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data (a1 :> a2) wX wY = (a1 wX wZ) :> (a2 wZ wY)
- data FL a wX wZ where
- data RL a wX wZ where
- data (a1 :\/: a2) wX wY = (a1 wZ wX) :\/: (a2 wZ wY)
- data (a3 :/\: a4) wX wY = (a3 wX wZ) :/\: (a4 wY wZ)
- data (a1 :||: a2) wX wY = (a1 wX wY) :||: (a2 wX wY)
- data Fork common left right wA wX wY = Fork (common wA wU) (left wU wX) (right wU wY)
- lengthFL :: FL a wX wZ -> Int
- mapFL :: (forall wW wZ. a wW wZ -> b) -> FL a wX wY -> [b]
- mapFL_FL :: (forall wW wY. a wW wY -> b wW wY) -> FL a wX wZ -> FL b wX wZ
- spanFL :: (forall wW wY. a wW wY -> Bool) -> FL a wX wZ -> (FL a :> FL a) wX wZ
- foldlFL :: (forall wW wY. a -> b wW wY -> a) -> a -> FL b wX wZ -> a
- allFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> Bool
- anyFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> Bool
- filterFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> [Sealed2 a]
- splitAtFL :: Int -> FL a wX wZ -> (FL a :> FL a) wX wZ
- splitAtRL :: Int -> RL a wX wZ -> (RL a :> RL a) wX wZ
- bunchFL :: Int -> FL a wX wY -> FL (FL a) wX wY
- foldlRL :: (forall wW wY. a -> b wW wY -> a) -> a -> RL b wX wZ -> a
- lengthRL :: RL a wX wZ -> Int
- isShorterThanRL :: RL a wX wY -> Int -> Bool
- mapRL :: (forall wW wZ. a wW wZ -> b) -> RL a wX wY -> [b]
- mapRL_RL :: (forall wW wY. a wW wY -> b wW wY) -> RL a wX wZ -> RL b wX wZ
- zipWithFL :: (forall wX wY. a -> p wX wY -> q wX wY) -> [a] -> FL p wW wZ -> FL q wW wZ
- filterOutFLFL :: (forall wX wY. p wX wY -> EqCheck wX wY) -> FL p wW wZ -> FL p wW wZ
- filterOutRLRL :: (forall wX wY. p wX wY -> EqCheck wX wY) -> RL p wW wZ -> RL p wW wZ
- filterRL :: (forall wX wY. p wX wY -> Bool) -> RL p wA wB -> [Sealed2 p]
- reverseFL :: FL a wX wZ -> RL a wX wZ
- reverseRL :: RL a wX wZ -> FL a wX wZ
- (+>+) :: FL a wX wY -> FL a wY wZ -> FL a wX wZ
- (+<+) :: RL a wX wY -> RL a wY wZ -> RL a wX wZ
- nullFL :: FL a wX wZ -> Bool
- concatFL :: FL (FL a) wX wZ -> FL a wX wZ
- concatRL :: RL (RL a) wX wZ -> RL a wX wZ
- snocRLSealed :: FlippedSeal (RL a) wY -> a wY wZ -> FlippedSeal (RL a) wZ
- nullRL :: RL a wX wZ -> Bool
- toFL :: [FreeLeft a] -> Sealed (FL a wX)
- dropWhileFL :: (forall wX wY. a wX wY -> Bool) -> FL a wR wV -> FlippedSeal (FL a) wV
- dropWhileRL :: (forall wX wY. a wX wY -> Bool) -> RL a wR wV -> Sealed (RL a wR)
- spanFL_M :: forall a m wX wZ. Monad m => (forall wW wY. a wW wY -> m Bool) -> FL a wX wZ -> m ((FL a :> FL a) wX wZ)
- mapFL_FL_M :: Monad m => (forall wW wY. a wW wY -> m (b wW wY)) -> FL a wX wZ -> m (FL b wX wZ)
- eqFL :: MyEq a => FL a wX wY -> FL a wX wZ -> EqCheck wY wZ
- eqFLRev :: MyEq a => FL a wX wZ -> FL a wY wZ -> EqCheck wX wY
- eqFLUnsafe :: MyEq a => FL a wX wY -> FL a wZ wW -> Bool
Directed Types
Darcs patches have a notion of transforming between contexts. This naturally leads us to container types that are "directed" and transform from one context to another.
For example, the swap of names of files x and y could be represented with the following sequence of patches:
Move x z:>
Move y x:>
Move z y
or using forward lists, like
Move x z:>:
Move y x:>:
Move z y:>:
NilFL
data FL a wX wZ where Source #
Forward lists
Show2 a => Show2 (FL a) Source # | |
Commute p => Commute (FL p) Source # | |
PatchDebug p => PatchDebug (FL p) Source # | |
PatchInspect p => PatchInspect (FL p) Source # | |
Invert p => Invert (FL p) Source # | |
Merge p => Merge (FL p) Source # | |
(ReadPatch p, PatchListFormat p) => ReadPatch (FL p) Source # | |
Apply p => Apply (FL p) Source # | |
RepairToFL p => Repair (FL p) Source # | |
Check p => Check (FL p) Source # | |
FromPrim p => FromPrims (FL p) Source # | |
FromPrim p => FromPrim (FL p) Source # | |
PrimPatchBase p => PrimPatchBase (FL p) Source # | |
Effect p => Effect (FL p) Source # | |
CommuteNoConflicts p => CommuteNoConflicts (FL p) Source # | |
(CommuteNoConflicts p, Conflict p) => Conflict (FL p) Source # | |
Show2 a => Show1 (FL a wX) Source # | |
Show2 a => Show (FL a wX wZ) Source # | |
type ApplyState (FL p) Source # | |
type PrimOf (FL p) Source # | |
data RL a wX wZ where Source #
Reverse lists
Show2 a => Show2 (RL a) Source # | |
Commute p => Commute (RL p) Source # | |
PatchDebug p => PatchDebug (RL p) Source # | |
PatchInspect p => PatchInspect (RL p) Source # | |
Invert p => Invert (RL p) Source # | |
Merge p => Merge (RL p) Source # | |
(ReadPatch p, PatchListFormat p) => ReadPatch (RL p) Source # | |
Apply p => Apply (RL p) Source # | |
Check p => Check (RL p) Source # | |
FromPrim p => FromPrims (RL p) Source # | |
PrimPatchBase p => PrimPatchBase (RL p) Source # | |
Effect p => Effect (RL p) Source # | |
CommuteNoConflicts p => CommuteNoConflicts (RL p) Source # | |
(CommuteNoConflicts p, Conflict p) => Conflict (RL p) Source # | |
Show2 a => Show1 (RL a wX) Source # | |
Show2 a => Show (RL a wX wZ) Source # | |
type ApplyState (RL p) Source # | |
type PrimOf (RL p) Source # | |
Merge Types
When we have two patches which commute and share the same pre-context we can
merge the patches. Whenever patches, or sequences of patches, share a
pre-context we say they are Forking Pairs (:\/:
). The same way, when
patches or sequences of patches, share a post-context we say they are
Joining Pairs (:/\:
).
The following diagram shows the symmetry of merge types:
wZ:/\:
a3 / \ a4 / \ wX wY \ / a1 \ / a2:\/:
wZ
data (a1 :\/: a2) wX wY infix 1 Source #
Forking Pairs (Implicit starting context)
(a1 wZ wX) :\/: (a2 wZ wY) infix 1 |
data Fork common left right wA wX wY Source #
Forking Pair (Explicit starting context)
wX wY \ / \ / \ / wU | | | wA
Fork (common wA wU) (left wU wX) (right wU wY) |
Functions
filterOutFLFL :: (forall wX wY. p wX wY -> EqCheck wX wY) -> FL p wW wZ -> FL p wW wZ Source #
filterOutFLFL p xs
deletes any x
in xs
for which p x == IsEq
(indicating that x
has no effect as far as we are concerned, and can be
safely removed from the chain)
snocRLSealed :: FlippedSeal (RL a) wY -> a wY wZ -> FlippedSeal (RL a) wZ Source #
dropWhileFL :: (forall wX wY. a wX wY -> Bool) -> FL a wR wV -> FlippedSeal (FL a) wV Source #
spanFL_M :: forall a m wX wZ. Monad m => (forall wW wY. a wW wY -> m Bool) -> FL a wX wZ -> m ((FL a :> FL a) wX wZ) Source #
mapFL_FL_M :: Monad m => (forall wW wY. a wW wY -> m (b wW wY)) -> FL a wX wZ -> m (FL b wX wZ) Source #