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)
- nullFL :: FL a wX wZ -> Bool
- nullRL :: RL a wX wZ -> Bool
- lengthFL :: FL a wX wZ -> Int
- lengthRL :: RL a wX wZ -> Int
- mapFL :: (forall wW wZ. a wW wZ -> b) -> FL a wX wY -> [b]
- mapRL :: (forall wW wZ. a wW wZ -> b) -> RL a wX wY -> [b]
- mapFL_FL :: (forall wW wY. a wW wY -> b wW wY) -> FL a wX wZ -> FL b wX wZ
- mapRL_RL :: (forall wW wY. a wW wY -> b wW wY) -> RL a wX wZ -> RL b wX wZ
- foldlFL :: (forall wW wY. a -> b wW wY -> a) -> a -> FL b wX wZ -> a
- foldlRL :: (forall wW wY. a -> b wW wY -> a) -> a -> RL b wX wZ -> a
- allFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> Bool
- allRL :: (forall wA wB. a wA wB -> Bool) -> RL a wX wY -> Bool
- anyFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> Bool
- anyRL :: (forall wA wB. a wA wB -> Bool) -> RL a wX wY -> Bool
- filterFL :: (forall wX wY. a wX wY -> Bool) -> FL a wW wZ -> [Sealed2 a]
- filterRL :: (forall wX wY. p wX wY -> Bool) -> RL p wA wB -> [Sealed2 p]
- splitAtFL :: Int -> FL a wX wZ -> (FL a :> FL a) wX wZ
- splitAtRL :: Int -> RL a wX wZ -> (RL a :> RL a) wX 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
- 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
- (+>>+) :: RL p wX wY -> FL p wY wZ -> FL p wX wZ
- (+<<+) :: RL p wX wY -> FL p wY wZ -> RL p wX wZ
- concatFL :: FL (FL a) wX wZ -> FL a wX wZ
- concatRL :: RL (RL a) wX wZ -> RL a wX wZ
- 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)
- bunchFL :: Int -> FL a wX wY -> FL (FL a) wX wY
- foldFL_M :: Monad m => (forall wA wB. r wA -> p wA wB -> m (r wB)) -> r wX -> FL p wX wY -> m (r wY)
- spanFL :: (forall wW wY. a wW wY -> Bool) -> FL a wX wZ -> (FL a :> FL a) wX wZ
- 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)
- zipWithFL :: (forall wX wY. a -> p wX wY -> q wX wY) -> [a] -> FL p wW wZ -> FL q wW wZ
- toFL :: [FreeLeft a] -> Sealed (FL a wX)
- mapFL_FL_M :: Monad m => (forall wW wY. a wW wY -> m (b wW wY)) -> FL a wX wZ -> m (FL b wX wZ)
- sequenceFL_ :: Monad m => (forall wW wZ. a wW wZ -> m b) -> FL a wX wY -> m ()
- eqFL :: Eq2 a => FL a wX wY -> FL a wX wZ -> EqCheck wY wZ
- eqFLRev :: Eq2 a => FL a wX wZ -> FL a wY wZ -> EqCheck wX wY
- eqFLUnsafe :: Eq2 a => FL a wX wY -> FL a wZ wW -> Bool
- initsFL :: FL p wX wY -> [Sealed ((p :> FL p) wX)]
- isShorterThanRL :: RL a wX wY -> Int -> Bool
- snocRLSealed :: FlippedSeal (RL a) wY -> a wY wZ -> FlippedSeal (RL a) wZ
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 # | |
Invert p => Invert (FL p) Source # | |
PatchInspect p => PatchInspect (FL p) Source # | |
PatchDebug p => PatchDebug (FL p) Source # | |
Commute p => Commute (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 # | |
Annotate p => Annotate (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 # | |
Invert p => Invert (RL p) Source # | |
PatchInspect p => PatchInspect (RL p) Source # | |
PatchDebug p => PatchDebug (RL p) Source # | |
Commute p => Commute (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 for FL
s and RL
s
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)
dropWhileFL :: (forall wX wY. a wX wY -> Bool) -> FL a wR wV -> FlippedSeal (FL a) wV Source #
FL
only
foldFL_M :: Monad m => (forall wA wB. r wA -> p wA wB -> m (r wB)) -> r wX -> FL p wX wY -> m (r wY) Source #
Monadic fold over an FL
associating to the left, i.e. from left to right.
The order of arguments follows the standard foldM
from base.
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 #
sequenceFL_ :: Monad m => (forall wW wZ. a wW wZ -> m b) -> FL a wX wY -> m () Source #
RL
only
snocRLSealed :: FlippedSeal (RL a) wY -> a wY wZ -> FlippedSeal (RL a) wZ Source #