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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Prim.Named

Description

Wrapper for prim patches to give them an identity derived from the identity of the containined Named patch.

Synopsis

- type NamedPrim = PrimWithName PrimPatchId
- data PrimPatchId
- namedPrim :: PrimPatchId -> p wX wY -> NamedPrim p wX wY
- positivePrimPatchIds :: PatchInfo -> [PrimPatchId]
- anonymousNamedPrim :: p wX wY -> NamedPrim p wX wY
- unsafePrimPatchId :: TestOnly => Int -> SHA1 -> PrimPatchId
- prop_primPatchIdNonZero :: PrimPatchId -> Bool

# Documentation

type NamedPrim = PrimWithName PrimPatchId #

data PrimPatchId #

Signed patch identity. The `SHA1` hash of the non-inverted meta data (`PatchInfo`) plus an `Int` for the sequence number within the named patch, starting with 1. The `Int` gets inverted together with the patch and must never be 0 else we could not distinguish between the patch and its inverse.

#### Instances

Instances details

SignedId PrimPatchId # |
Instance details Defined in Darcs.Patch.Prim.Named Methods positiveId :: PrimPatchId -> Bool # invertId :: PrimPatchId -> PrimPatchId #
StorableId PrimPatchId # |
Instance details Defined in Darcs.Patch.Prim.Named Methods readId :: Parser PrimPatchId # showId :: ShowPatchFor -> PrimPatchId -> Doc #
Show PrimPatchId # |
Instance details Defined in Darcs.Patch.Prim.Named Methods showsPrec :: Int -> PrimPatchId -> ShowS # show :: PrimPatchId -> String # showList :: [PrimPatchId] -> ShowS #
Eq PrimPatchId # |
Instance details Defined in Darcs.Patch.Prim.Named Methods (==) :: PrimPatchId -> PrimPatchId -> Bool # (/=) :: PrimPatchId -> PrimPatchId -> Bool #
Ord PrimPatchId # |
Instance details Defined in Darcs.Patch.Prim.Named Methods compare :: PrimPatchId -> PrimPatchId -> Ordering # (<) :: PrimPatchId -> PrimPatchId -> Bool # (<=) :: PrimPatchId -> PrimPatchId -> Bool # (>) :: PrimPatchId -> PrimPatchId -> Bool # (>=) :: PrimPatchId -> PrimPatchId -> Bool # max :: PrimPatchId -> PrimPatchId -> PrimPatchId # min :: PrimPatchId -> PrimPatchId -> PrimPatchId #
FromPrim (RepoPatchV3 prim) # |
Instance details Defined in Darcs.Patch.V3 Methods fromAnonymousPrim :: PrimOf (RepoPatchV3 prim) wX wY -> RepoPatchV3 prim wX wY # fromPrim :: PatchId (RepoPatchV3 prim) -> PrimOf (RepoPatchV3 prim) wX wY -> RepoPatchV3 prim wX wY # fromPrims :: PatchInfo -> FL (PrimOf (RepoPatchV3 prim)) wX wY -> FL (RepoPatchV3 prim) wX wY #
type PatchId (NamedPrim p) # |
Instance details Defined in Darcs.Patch.Prim.Named type PatchId (NamedPrim p) = PrimPatchId

namedPrim :: PrimPatchId -> p wX wY -> NamedPrim p wX wY #

positivePrimPatchIds :: PatchInfo -> [PrimPatchId] #

Create an infinite list of positive `PrimPatchId`s.

anonymousNamedPrim :: p wX wY -> NamedPrim p wX wY #

unsafePrimPatchId :: TestOnly => Int -> SHA1 -> PrimPatchId #

This should only be used for testing, as it exposes the internal structure of a `PrimPatchId`.

prop_primPatchIdNonZero :: PrimPatchId -> Bool #