Safe Haskell | None |
---|
- type FileCache = FileCacheR String
- data FileCacheR r a
- newFileCache :: Error r => IO (FileCacheR r a)
- killFileCache :: FileCacheR r a -> IO ()
- invalidate :: Error r => FilePath -> FileCacheR r a -> IO ()
- query :: Error r => FileCacheR r a -> FilePath -> IO (Either r a) -> IO (Either r a)
- getCache :: Error r => FileCacheR r a -> IO (HashMap FilePath (Either r a, WatchDescriptor))
- lazyQuery :: Error r => FileCacheR r a -> FilePath -> IO (Either r a) -> IO (Either r a)
Documentation
type FileCache = FileCacheR StringSource
data FileCacheR r a Source
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.
:: 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.