darcs-2.18.5: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Set

Synopsis

- data PatchSet (p :: Type -> Type -> Type) wStart wY where
  - PatchSet :: forall (p :: Type -> Type -> Type) wX wY. RL (Tagged p) Origin wX -> RL (PatchInfoAnd p) wX wY -> PatchSet p Origin wY
- data Tagged (p :: Type -> Type -> Type) wX wZ where
  - Tagged :: forall (p :: Type -> Type -> Type) wX wY wZ. RL (PatchInfoAnd p) wX wY -> PatchInfoAnd p wY wZ -> Maybe InventoryHash -> Tagged p wX wZ
- type SealedPatchSet (p :: Type -> Type -> Type) wStart = Sealed (PatchSet p wStart)
- data Origin
- progressPatchSet :: forall (p :: Type -> Type -> Type) wStart wX. String -> PatchSet p wStart wX -> PatchSet p wStart wX
- patchSetInventoryHashes :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> [Maybe InventoryHash]
- patchSetTags :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> [String]
- emptyPatchSet :: forall (p :: Type -> Type -> Type). PatchSet p Origin Origin
- appendPSFL :: forall (p :: Type -> Type -> Type) wStart wX wY. PatchSet p wStart wX -> FL (PatchInfoAnd p) wX wY -> PatchSet p wStart wY
- patchSet2RL :: forall (p :: Type -> Type -> Type) wStart wX. PatchSet p wStart wX -> RL (PatchInfoAnd p) wStart wX
- patchSet2FL :: forall (p :: Type -> Type -> Type) wStart wX. PatchSet p wStart wX -> FL (PatchInfoAnd p) wStart wX
- inOrderTags :: forall (p :: Type -> Type -> Type) wS wX. PatchSet p wS wX -> [PatchInfo]
- patchSetSnoc :: forall (p :: Type -> Type -> Type) wX wY wZ. PatchSet p wX wY -> PatchInfoAnd p wY wZ -> PatchSet p wX wZ
- patchSetSplit :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> (PatchSet p :> RL (PatchInfoAnd p)) wX wY
- patchSetDrop :: forall (p :: Type -> Type -> Type) wStart wX. Int -> PatchSet p wStart wX -> SealedPatchSet p wStart

# Documentation

data PatchSet (p :: Type -> Type -> Type) wStart wY where #

The patches in a repository are stored in chunks broken up at "clean" tags. A tag is clean if the only patches before it in the current repository ordering are ones that the tag depends on (either directly or indirectly). Each chunk is stored in a separate inventory file on disk.

A `PatchSet` represents a repo's history as the list of patches since the last clean tag, and then a list of patch lists each delimited by clean tags.

Because the invariants about clean tags can only be maintained if a `PatchSet` contains the whole history, the first witness is always forced to be `Origin`. The type still has two witnesses so it can easily be used with combinators like `:>` and `Fork`.

The history is lazily loaded from disk so does not normally need to be all kept in memory.

Constructors

PatchSet :: forall (p :: Type -> Type -> Type) wX wY. RL (Tagged p) Origin wX -> RL (PatchInfoAnd p) wX wY -> PatchSet p Origin wY |

#### Instances

Instances details

Ident (PatchSet p) # |
Instance details Defined in Darcs.Patch.Set Methods ident :: PatchSet p wX wY -> PatchId (PatchSet p) #
Show2 p => Show2 (PatchSet p) # |
Instance details Defined in Darcs.Patch.Set Methods showDict2 :: ShowDict (PatchSet p wX wY) #
Show2 p => Show1 (PatchSet p wStart) # |
Instance details Defined in Darcs.Patch.Set Methods showDict1 :: Dict (Show (PatchSet p wStart wX)) #
Show2 p => Show (PatchSet p wStart wY) # |
Instance details Defined in Darcs.Patch.Set Methods showsPrec :: Int -> PatchSet p wStart wY -> ShowS # show :: PatchSet p wStart wY -> String # showList :: [PatchSet p wStart wY] -> ShowS #
type PatchId (PatchSet p) # |
Instance details Defined in Darcs.Patch.Set type PatchId (PatchSet p) = Set PatchInfo

data Tagged (p :: Type -> Type -> Type) wX wZ where #

A `Tagged` is a single chunk of a `PatchSet`. It has a `PatchInfo` representing a clean tag, the hash of the previous inventory (if it exists), and the list of patches since that previous inventory.

Constructors

Tagged :: forall (p :: Type -> Type -> Type) wX wY wZ. RL (PatchInfoAnd p) wX wY -> PatchInfoAnd p wY wZ -> Maybe InventoryHash -> Tagged p wX wZ |

#### Instances

Instances details

Show2 p => Show2 (Tagged p) # |
Instance details Defined in Darcs.Patch.Set Methods showDict2 :: ShowDict (Tagged p wX wY) #
Show2 p => Show1 (Tagged p wX) # |
Instance details Defined in Darcs.Patch.Set Methods showDict1 :: Dict (Show (Tagged p wX wX0)) #
Show2 p => Show (Tagged p wX wZ) # |
Instance details Defined in Darcs.Patch.Set Methods showsPrec :: Int -> Tagged p wX wZ -> ShowS # show :: Tagged p wX wZ -> String # showList :: [Tagged p wX wZ] -> ShowS #

type SealedPatchSet (p :: Type -> Type -> Type) wStart = Sealed (PatchSet p wStart) #

data Origin #

`Origin` is a type used to represent the initial context of a repo.

progressPatchSet :: forall (p :: Type -> Type -> Type) wStart wX. String -> PatchSet p wStart wX -> PatchSet p wStart wX #

Runs a progress action for each tag and patch in a given PatchSet, using the passed progress message. Does not alter the PatchSet.

patchSetInventoryHashes :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> [Maybe InventoryHash] #

patchSetTags :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> [String] #

The tag names of all tags of a given `PatchSet`.

emptyPatchSet :: forall (p :: Type -> Type -> Type). PatchSet p Origin Origin #

appendPSFL :: forall (p :: Type -> Type -> Type) wStart wX wY. PatchSet p wStart wX -> FL (PatchInfoAnd p) wX wY -> PatchSet p wStart wY #

`appendPSFL` takes a `PatchSet` and a `FL` of patches that "follow" the PatchSet, and concatenates the patches into the PatchSet.

patchSet2RL :: forall (p :: Type -> Type -> Type) wStart wX. PatchSet p wStart wX -> RL (PatchInfoAnd p) wStart wX #

`patchSet2RL` takes a `PatchSet` and returns an equivalent, linear `RL` of patches.

patchSet2FL :: forall (p :: Type -> Type -> Type) wStart wX. PatchSet p wStart wX -> FL (PatchInfoAnd p) wStart wX #

`patchSet2FL` takes a `PatchSet` and returns an equivalent, linear `FL` of patches.

inOrderTags :: forall (p :: Type -> Type -> Type) wS wX. PatchSet p wS wX -> [PatchInfo] #

patchSetSnoc :: forall (p :: Type -> Type -> Type) wX wY wZ. PatchSet p wX wY -> PatchInfoAnd p wY wZ -> PatchSet p wX wZ #

patchSetSplit :: forall (p :: Type -> Type -> Type) wX wY. PatchSet p wX wY -> (PatchSet p :> RL (PatchInfoAnd p)) wX wY #

Split a `PatchSet` before the latest known clean tag. The left part is what comes before the tag, the right part is the tag and its non-dependencies.

patchSetDrop :: forall (p :: Type -> Type -> Type) wStart wX. Int -> PatchSet p wStart wX -> SealedPatchSet p wStart #

Drop the last `n` patches from the given `PatchSet`.