Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data DiskHashRO a
- data DiskHashRW a
- htOpenRO :: forall a. Storable a => FilePath -> Int -> IO (DiskHashRO a)
- htOpenRW :: forall a. Storable a => FilePath -> Int -> IO (DiskHashRW a)
- withDiskHashRW :: Storable a => FilePath -> Int -> (DiskHashRW a -> IO b) -> IO b
- htLookupRO :: Storable a => ByteString -> DiskHashRO a -> Maybe a
- htLookupRW :: Storable a => ByteString -> DiskHashRW a -> IO (Maybe a)
- htSizeRW :: DiskHashRW a -> IO Int
- htSizeRO :: DiskHashRO a -> Int
- htInsert :: Storable a => ByteString -> a -> DiskHashRW a -> IO Bool
- htModify :: Storable a => ByteString -> (a -> a) -> DiskHashRW a -> IO Bool
- htReserve :: Storable a => Int -> DiskHashRW a -> IO Int
Documentation
data DiskHashRO a Source #
data DiskHashRW a Source #
htOpenRO :: forall a. Storable a => FilePath -> Int -> IO (DiskHashRO a) Source #
open a hash table in read-only mode
htOpenRW :: forall a. Storable a => FilePath -> Int -> IO (DiskHashRW a) Source #
open a hash table in read-write mode
withDiskHashRW :: Storable a => FilePath -> Int -> (DiskHashRW a -> IO b) -> IO b Source #
Open a hash table in read-write mode and pass it to an action
Once the action is is complete, the hashtable is closed (and sync'ed to disk).
htLookupRO :: Storable a => ByteString -> DiskHashRO a -> Maybe a Source #
Lookup by key
htLookupRW :: Storable a => ByteString -> DiskHashRW a -> IO (Maybe a) Source #
Lookup by key
htSizeRO :: DiskHashRO a -> Int Source #
Retrieve the size of the hash table
:: Storable a | |
=> ByteString | key |
-> a | value |
-> DiskHashRW a | hash table |
-> IO Bool | True if inserted, False if not |
insert an element into the hash table
Returns whether an insertion took place (if an object with that key already exists, no insertion is made).
htModify :: Storable a => ByteString -> (a -> a) -> DiskHashRW a -> IO Bool Source #
Modify a value