Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Database as [[(key,value)]]
Synopsis
- type Entry k v = (k, v)
- type Record k v = [Entry k v]
- type Db k v = [Record k v]
- type Key = String
- type Value = String
- type Entry' = Entry Key Value
- type Record' = Record Key Value
- type Db' = Db Key Value
- record_key_seq :: Record k v -> [k]
- record_has_key :: Eq k => k -> Record k v -> Bool
- record_key_histogram :: Ord k => Record k v -> [(k, Int)]
- record_has_duplicate_keys :: Ord k => Record k v -> Bool
- record_lookup_by :: (k -> k -> Bool) -> k -> Record k v -> [v]
- record_lookup :: Eq k => k -> Record k v -> [v]
- record_lookup_at :: Eq k => (k, Int) -> Record k v -> Maybe v
- record_lookup_uniq :: Eq k => k -> Record k v -> Maybe v
- record_has_key_uniq :: Eq k => k -> Record k v -> Bool
- record_lookup_uniq_err :: Eq k => k -> Record k v -> v
- record_lookup_uniq_def :: Eq k => v -> k -> Record k v -> v
- record_delete_by :: (k -> k -> Bool) -> k -> Record k v -> Record k v
- record_delete :: Eq k => k -> Record k v -> Record k v
- db_key_set :: Ord k => Db k v -> [k]
- db_lookup_by :: (k -> k -> Bool) -> (v -> v -> Bool) -> k -> v -> Db k v -> [Record k v]
- db_lookup :: (Eq k, Eq v) => k -> v -> Db k v -> [Record k v]
- db_has_duplicate_keys :: Ord k => Db k v -> Bool
- db_key_histogram :: Ord k => Db k v -> [(k, Int)]
- db_to_table :: Ord k => (Maybe v -> e) -> Db k v -> ([k], [[e]])
- record_collate_from :: Eq k => (k, [v]) -> Record k v -> Record k [v]
- record_collate :: Eq k => Record k v -> Record k [v]
- record_uncollate :: Record k [v] -> Record k v
Type
Record
record_key_seq :: Record k v -> [k] Source #
The sequence of keys at Record
.
record_lookup_by :: (k -> k -> Bool) -> k -> Record k v -> [v] Source #
Find all associations for key using given equality function.
record_lookup :: Eq k => k -> Record k v -> [v] Source #
record_lookup_by
of ==
.
record_lookup_at :: Eq k => (k, Int) -> Record k v -> Maybe v Source #
nth element of record_lookup
.
record_lookup_uniq :: Eq k => k -> Record k v -> Maybe v Source #
Variant of record_lookup
requiring a unique key. Nothing
indicates
there is no entry, it is an error
if duplicate keys are present.
record_lookup_uniq_err :: Eq k => k -> Record k v -> v Source #
Error variant.
record_lookup_uniq_def :: Eq k => v -> k -> Record k v -> v Source #
Default value variant.
record_delete_by :: (k -> k -> Bool) -> k -> Record k v -> Record k v Source #
Remove all associations for key using given equality function.
record_delete :: Eq k => k -> Record k v -> Record k v Source #
record_delete_by
of ==
.
Db
db_key_set :: Ord k => Db k v -> [k] Source #
Preserves order of occurence.
Collating duplicate keys.
record_collate :: Eq k => Record k v -> Record k [v] Source #
Collate adjacent entries of existing sequence with equal key.
record_uncollate :: Record k [v] -> Record k v Source #