Safe Haskell | None |
---|
- data Identifiers i a
- empty :: Identifiers i a
- fromList :: (Integral i, Hashable a, Eq a) => [a] -> Identifiers i a
- insert :: (Integral i, Hashable a, Eq a) => Identifiers i a -> a -> Identifiers i a
- insertMany :: (Integral i, Hashable a, Eq a) => Identifiers i a -> [a] -> Identifiers i a
- size :: Identifiers i a -> Int
- toList :: Identifiers i a -> [a]
- lookupId :: (Hashable a, Eq a) => Identifiers i a -> a -> Maybe i
- lookupKey :: Integral i => Identifiers i a -> i -> Maybe a
- lookupKeys :: Integral i => Identifiers i a -> [i] -> [a]
- unsafeLookupId :: (Hashable a, Eq a) => Identifiers i a -> a -> i
- unsafeLookupKey :: Integral i => Identifiers i a -> i -> a
- (!) :: Integral i => Identifiers i a -> i -> a
- prop_hasId :: String -> Bool
- prop_stableId :: String -> Bool
- prop_keyRetrieval :: [String] -> Bool
- prop_keyRetrievalUnsafe :: [String] -> Bool
- prop_idempotent :: String -> Bool
Documentation
data Identifiers i a Source
(Eq i, Eq a) => Eq (Identifiers i a) | |
Show a => Show (Identifiers i a) | |
(Binary i, Eq a, Hashable a, Binary a) => Binary (Identifiers i a) | |
(Serialize i, Eq a, Hashable a, Serialize a) => Serialize (Identifiers i a) | |
(NFData i, NFData a) => NFData (Identifiers i a) |
Construction
empty :: Identifiers i aSource
The empty Identifiers
Insertion
insert :: (Integral i, Hashable a, Eq a) => Identifiers i a -> a -> Identifiers i aSource
Insert item into set (given it a new id)
insertMany :: (Integral i, Hashable a, Eq a) => Identifiers i a -> [a] -> Identifiers i aSource
Insert many items into set
Info
size :: Identifiers i a -> IntSource
Extraction
toList :: Identifiers i a -> [a]Source
New List from Identifiers
Lookups
lookupKey :: Integral i => Identifiers i a -> i -> Maybe aSource
Find key for given id
lookupKeys :: Integral i => Identifiers i a -> [i] -> [a]Source
Given many ids, return many keys
unsafeLookupId :: (Hashable a, Eq a) => Identifiers i a -> a -> iSource
unsafeLookupKey :: Integral i => Identifiers i a -> i -> aSource
(!) :: Integral i => Identifiers i a -> i -> aSource
Properties
prop_hasId :: String -> BoolSource
Items inserted are given ids
prop_stableId :: String -> BoolSource
Inserted items have stable ids
prop_keyRetrieval :: [String] -> BoolSource
Given id can be used to fetch inserted item
prop_keyRetrievalUnsafe :: [String] -> BoolSource
Given id can be used to fetch inserted item
prop_idempotent :: String -> BoolSource
Inserting something more than once does not change the set