This module provides a general interface for databases (persistent predicates) where each entry consists of a key and an info part. The key is an integer and the info is arbitrary. All functions are parameterized with a dynamic predicate that takes an integer key as a first parameter.
Remark:
This library has been revised to the library KeyDatabase
.
Thus, it might not be further supported in the future.
Author: Bernd Brassel, Michael Hanus
Version: January 2006
existsDBKey
:: (Int -> a -> Dynamic) -> Int -> IO Bool
Exists an entry with a given key in the database? |
allDBKeys
:: (Int -> a -> Dynamic) -> IO [Int]
Returns all keys of entries in the database. |
getDBInfo
:: (Int -> a -> Dynamic) -> Int -> IO a
Gets the information about an entry in the database. |
index
:: a -> [a] -> Int
compute the position of an entry in a list fail, if given entry is not an element. |
sortByIndex
:: [(Int,a)] -> [a]
Sorts a given list by associated index . |
groupByIndex
:: [(Int,a)] -> [[a]]
Sorts a given list by associated index and group for identical index. |
getDBInfos
:: (Int -> a -> Dynamic) -> [Int] -> IO [a]
Gets the information about a list of entries in the database. |
deleteDBEntry
:: (Int -> a -> Dynamic) -> Int -> IO ()
Deletes an entry with a given key in the database. |
updateDBEntry
:: (Int -> a -> Dynamic) -> Int -> a -> IO ()
Overwrites an existing entry in the database. |
newDBEntry
:: (Int -> a -> Dynamic) -> a -> IO Int
Stores a new entry in the database and return the key of the new entry. |
cleanDB
:: (Int -> a -> Dynamic) -> IO ()
Deletes all entries in the database. |
Exists an entry with a given key in the database?
|
Gets the information about an entry in the database.
|
compute the position of an entry in a list fail, if given entry is not an element.
|
Sorts a given list by associated index . |
Sorts a given list by associated index and group for identical index. Empty lists are added for missing indexes |
Gets the information about a list of entries in the database.
|
Deletes an entry with a given key in the database.
|
Overwrites an existing entry in the database.
|
Stores a new entry in the database and return the key of the new entry.
|