Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 Source #
data PrimPatchId Source #
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
namedPrim :: PrimPatchId -> p wX wY -> NamedPrim p wX wY Source #
positivePrimPatchIds :: PatchInfo -> [PrimPatchId] Source #
Create an infinite list of positive PrimPatchId
s.
anonymousNamedPrim :: p wX wY -> NamedPrim p wX wY Source #
unsafePrimPatchId :: TestOnly => Int -> SHA1 -> PrimPatchId Source #
This should only be used for testing, as it exposes the internal structure
of a PrimPatchId
.