filecache-0.2.2: A Linux-only cache system associating values to files. The values are discarded when the files are modified.

Safe HaskellNone

Data.FileCache

Synopsis

Documentation

newFileCache :: Error r => IO (FileCacheR r a)Source

Generates a new file cache. The opaque type is for use with other functions.

killFileCache :: FileCacheR r a -> IO ()Source

Destroys the thread running the FileCache. Pretty dangerous stuff.

invalidate :: Error r => FilePath -> FileCacheR r a -> IO ()Source

Manually invalidates an entry.

querySource

Arguments

:: Error r 
=> FileCacheR r a 
-> FilePath

Path of the file entry

-> IO (Either r a)

The computation that will be used to populate the cache

-> IO (Either r a) 

Queries the cache, populating it if necessary.

getCache :: Error r => FileCacheR r a -> IO (HashMap FilePath (Either r a, WatchDescriptor))Source

Gets a copy of the cache.

lazyQuerySource

Arguments

:: Error r 
=> FileCacheR r a 
-> FilePath

Path of the file entry

-> IO (Either r a)

The computation that will be used to populate the cache

-> IO (Either r a) 

Just like query, but with the standard Either type.