Copyright | (c) Amy de Buitléir 2014-2015 |
---|---|
License | BSD-style |
Maintainer | amy@nualeargais.ie |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
A module containing private CachedFileSystem internals. Most developers should use CachedFileSystem instead. This module is subject to change without notice.
- data CachedFSDatabase r = CachedFSDatabase {
- database :: FSDatabase r
- cache :: [r]
- maxCacheSize :: Int
- withFSDB :: Monad m => StateT (FSDatabase r) m a -> StateT (CachedFSDatabase r) m a
- fromCache :: Record r => String -> StateT (CachedFSDatabase r) IO (Maybe r)
- addToCache :: SizedRecord r => r -> StateT (CachedFSDatabase r) IO ()
- deleteByKeyFromCache :: SizedRecord r => String -> StateT (CachedFSDatabase r) IO ()
- deleteFromCache :: SizedRecord r => r -> StateT (CachedFSDatabase r) IO ()
- trimCache :: SizedRecord r => StateT (CachedFSDatabase r) IO ()
- trim :: SizedRecord r => Int -> [r] -> [r]
- listSize :: SizedRecord r => [r] -> Int
- mkCachedFSDatabase :: FilePath -> Int -> CachedFSDatabase r
Documentation
data CachedFSDatabase r Source
A simple database where each record is stored in a separate file, and the name of the file is the record's key.
CachedFSDatabase | |
|
Eq r => Eq (CachedFSDatabase r) Source | |
Show r => Show (CachedFSDatabase r) Source | |
SizedRecord r => Database (CachedFSDatabase r) Source | |
type DBRecord (CachedFSDatabase r) = r Source |
withFSDB :: Monad m => StateT (FSDatabase r) m a -> StateT (CachedFSDatabase r) m a Source
addToCache :: SizedRecord r => r -> StateT (CachedFSDatabase r) IO () Source
deleteByKeyFromCache :: SizedRecord r => String -> StateT (CachedFSDatabase r) IO () Source
deleteFromCache :: SizedRecord r => r -> StateT (CachedFSDatabase r) IO () Source
trimCache :: SizedRecord r => StateT (CachedFSDatabase r) IO () Source
trim :: SizedRecord r => Int -> [r] -> [r] Source
listSize :: SizedRecord r => [r] -> Int Source
mkCachedFSDatabase :: FilePath -> Int -> CachedFSDatabase r Source
(re)creates the FSDatabase in the
directory mkFSDatabase
dd
.