-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Cache for HXT XML Documents and other binary data -- -- Extension for caching XML documents and other binary data in cache -- directory of the local filesystem. The module exports a version of -- readDocument with the additional cache functionality. @package hxt-cache @version 0.0.4 module Control.Concurrent.ResourceTable type ResourceTable a = MVar (Map a ResourceLock) type ResourceLock = (MVar (), Int) requestResource :: (Ord a) => ResourceTable a -> a -> IO () releaseResource :: (Ord a) => ResourceTable a -> a -> IO () newResourceTable :: IO (ResourceTable a) -- | Caching of XML document trees and other binary data module Text.XML.HXT.Arrow.XmlCache -- | This readDocument is a wrapper for the -- Text.XML.HXT.Arrow.ReadDocument.readDocument function. The -- function is controlled by the options a_cache, -- a_compress and a_document_age. -- -- readDocument :: Attributes -> String -> IOStateArrow s b XmlTree a_cache :: String a_compress :: String a_document_age :: String lookupCache :: (NFData b, Binary b) => CacheConfig -> String -> IOStateArrow s a b writeCache :: (Binary b) => CacheConfig -> String -> IOStateArrow s b () -- | Compute the SHA1 hash is hexadecimal format for an arbitray -- serializable value sha1HashValue :: (Arrow a, Binary b) => a b Integer sha1HashString :: (Arrow a, Binary b) => a b String data CacheConfig CC :: FilePath -> Bool -> Integer -> CacheConfig c_dir :: CacheConfig -> FilePath c_compress :: CacheConfig -> Bool c_age :: CacheConfig -> Integer -- | Arrow for checking if a document is in the cache. The arrow fails if -- document not there, else the file modification time is returned. isInCache :: Attributes -> IOStateArrow s String ClockTime isInCache' :: CacheConfig -> String -> IO (Maybe ClockTime)