Skip to content
Snippets Groups Projects
Commit 8d186905 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Merge branch 'ord-instances' into 'main'

Add `Ord` instances for capability types

See merge request !15
parents 8f73a870 1caae680
No related branches found
No related tags found
1 merge request!15Add `Ord` instances for capability types
Pipeline #4810 passed
cabal.project.local
.direnv
.pre-commit-config.yaml
*~
...@@ -53,6 +53,9 @@ data Verifier = Verifier ...@@ -53,6 +53,9 @@ data Verifier = Verifier
} }
deriving (Eq, Show) deriving (Eq, Show)
instance Ord Verifier where
a <= b = verifierStorageIndex a <= verifierStorageIndex b
instance ConfidentialShowable Verifier where instance ConfidentialShowable Verifier where
confidentiallyShow = dangerRealShow . SDMFVerifier confidentiallyShow = dangerRealShow . SDMFVerifier
...@@ -63,6 +66,9 @@ data Reader = Reader ...@@ -63,6 +66,9 @@ data Reader = Reader
} }
deriving (Eq, Show) deriving (Eq, Show)
instance Ord Reader where
a <= b = readerVerifier a <= readerVerifier b
instance ConfidentialShowable Reader where instance ConfidentialShowable Reader where
confidentiallyShow = dangerRealShow . SDMFReader confidentiallyShow = dangerRealShow . SDMFReader
...@@ -73,6 +79,9 @@ data Writer = Writer ...@@ -73,6 +79,9 @@ data Writer = Writer
} }
deriving (Eq, Show) deriving (Eq, Show)
instance Ord Writer where
a <= b = writerReader a <= writerReader b
instance ConfidentialShowable Writer where instance ConfidentialShowable Writer where
confidentiallyShow = dangerRealShow . SDMFWriter confidentiallyShow = dangerRealShow . SDMFWriter
......
...@@ -86,7 +86,7 @@ instance Binary Read where ...@@ -86,7 +86,7 @@ instance Binary Read where
let (CryptoPassed unRead) = cipherInit readKeyBytes let (CryptoPassed unRead) = cipherInit readKeyBytes
pure Read{..} pure Read{..}
newtype StorageIndex = StorageIndex {unStorageIndex :: B.ByteString} deriving newtype (Eq) newtype StorageIndex = StorageIndex {unStorageIndex :: B.ByteString} deriving newtype (Eq, Ord)
instance Show StorageIndex where instance Show StorageIndex where
show (StorageIndex si) = show (StorageIndex si) =
......
...@@ -21,7 +21,7 @@ name: tahoe-ssk ...@@ -21,7 +21,7 @@ name: tahoe-ssk
-- PVP summary: +-+------- breaking API changes -- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions -- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change -- | | | +--- code changes with no API change
version: 0.2.0.0 version: 0.2.1.0
-- A short (one-line) description of the package. -- A short (one-line) description of the package.
synopsis: synopsis:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment