Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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 a Source
The empty Identifiers
fromList :: (Integral i, Hashable a, Eq a) => [a] -> Identifiers i a Source
New Identifiers from list
Insertion
insert :: (Integral i, Hashable a, Eq a) => Identifiers i a -> a -> Identifiers i a Source
Insert item into set (given it a new id)
insertMany :: (Integral i, Hashable a, Eq a) => Identifiers i a -> [a] -> Identifiers i a Source
Insert many items into set
Info
size :: Identifiers i a -> Int Source
Extraction
toList :: Identifiers i a -> [a] Source
New List from Identifiers
Lookups
lookupKey :: Integral i => Identifiers i a -> i -> Maybe a Source
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 -> i Source
unsafeLookupKey :: Integral i => Identifiers i a -> i -> a Source
(!) :: Integral i => Identifiers i a -> i -> a Source
Properties
prop_hasId :: String -> Bool Source
Items inserted are given ids
prop_stableId :: String -> Bool Source
Inserted items have stable ids
prop_keyRetrieval :: [String] -> Bool Source
Given id can be used to fetch inserted item
prop_keyRetrievalUnsafe :: [String] -> Bool Source
Given id can be used to fetch inserted item
prop_idempotent :: String -> Bool Source
Inserting something more than once does not change the set