TCache 0.5.5 → 0.6.4
raw patch · 40 files changed
+13742/−851 lines, 40 filesdep +RefSerializedep +containersbinary-addedPVP ok
version bump matches the API change (PVP)
Dependencies added: RefSerialize, containers
API changes (from Hackage documentation)
- Data.TCache: Delete :: b -> Operation b
- Data.TCache: Insert :: b -> Operation b
- Data.TCache: data Operation b
- Data.TCache: withResourcesID :: (IResource a) => [a] -> ([Maybe a] -> [Operation a]) -> IO ()
- Data.TCache.Dynamic: Delete :: b -> Operation b
- Data.TCache.Dynamic: Insert :: b -> Operation b
- Data.TCache.Dynamic: data Operation b
- Data.TCache.Dynamic: getDTVars :: [IDynamic] -> IO [Maybe (TVar IDynamic)]
- Data.TCache.Dynamic: instance (IResource x, Typeable x) => DynamicInterface x
- Data.TCache.Dynamic: instance IResource IDynamic
- Data.TCache.Dynamic: instance IResource Key
- Data.TCache.Dynamic: instance Show IDynamic
- Data.TCache.Dynamic: instance Typeable IDynamic
- Data.TCache.Dynamic: instance Typeable Key
- Data.TCache.Dynamic: withDResourcesID :: [IDynamic] -> ([Maybe IDynamic] -> [Operation IDynamic]) -> IO ()
- Data.TCache.Dynamic: withResourcesID :: (Typeable a, IResource a) => [a] -> ([Maybe a] -> [Operation a]) -> IO ()
+ Data.TCache: Resources :: [a] -> [a] -> b -> Resources a b
+ Data.TCache: Retry :: Resources a b
+ Data.TCache: data Resources a b
+ Data.TCache: getTVarsIO :: (IResource a) => [a] -> IO [TVar a]
+ Data.TCache: newCache :: IO (Ht a, Integer)
+ Data.TCache: releaseTVars :: (IResource a) => [a] -> STM ()
+ Data.TCache: resources :: Resources a ()
+ Data.TCache: toAdd :: Resources a b -> [a]
+ Data.TCache: toDelete :: Resources a b -> [a]
+ Data.TCache: toReturn :: Resources a b -> b
+ Data.TCache: treadp :: (IResource a) => ST a
+ Data.TCache: tshowp :: (IResource a) => a -> ST String
+ Data.TCache: withSTMResources :: (IResource a) => [a] -> ([Maybe a] -> Resources a x) -> STM x
+ Data.TCache.Dynamic: Resources :: [a] -> [a] -> b -> Resources a b
+ Data.TCache.Dynamic: Retry :: Resources a b
+ Data.TCache.Dynamic: data Resources a b
+ Data.TCache.Dynamic: getTVars :: [IDynamic] -> STM [Maybe (TVar IDynamic)]
+ Data.TCache.Dynamic: getTVarsIO :: [IDynamic] -> IO [TVar IDynamic]
+ Data.TCache.Dynamic: releaseTVars :: [IDynamic] -> STM ()
+ Data.TCache.Dynamic: resources :: Resources a ()
+ Data.TCache.Dynamic: safeFromIDyn :: (DynamicInterface x) => IDynamic -> Maybe x
+ Data.TCache.Dynamic: toAdd :: Resources a b -> [a]
+ Data.TCache.Dynamic: toDelete :: Resources a b -> [a]
+ Data.TCache.Dynamic: toReturn :: Resources a b -> b
+ Data.TCache.Dynamic: treadp :: (IResource a) => ST a
+ Data.TCache.Dynamic: tshowp :: (IResource a) => a -> ST String
+ Data.TCache.Dynamic: withDSTMResources :: [IDynamic] -> ([Maybe IDynamic] -> Resources IDynamic x) -> STM x
+ Data.TCache.Dynamic: withSTMResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> ([Maybe a] -> Resources b x) -> STM x
+ Data.TCache.IDynamic: IDynamic :: a -> IDynamic
+ Data.TCache.IDynamic: Key :: TypeRep -> String -> Key
+ Data.TCache.IDynamic: class DynamicInterface x
+ Data.TCache.IDynamic: data IDynamic
+ Data.TCache.IDynamic: data Key
+ Data.TCache.IDynamic: fromIDyn :: (DynamicInterface x) => IDynamic -> x
+ Data.TCache.IDynamic: instance (IResource x, Typeable x) => DynamicInterface x
+ Data.TCache.IDynamic: instance IResource IDynamic
+ Data.TCache.IDynamic: instance IResource Key
+ Data.TCache.IDynamic: instance Show IDynamic
+ Data.TCache.IDynamic: instance Typeable IDynamic
+ Data.TCache.IDynamic: instance Typeable Key
+ Data.TCache.IDynamic: list :: MVar (Map Word (IDynamic -> IO (Maybe IDynamic), String -> IDynamic, ST IDynamic))
+ Data.TCache.IDynamic: registerType :: (DynamicInterface x) => IO x
+ Data.TCache.IDynamic: safeFromIDyn :: (DynamicInterface x) => IDynamic -> Maybe x
+ Data.TCache.IDynamic: toIDyn :: (DynamicInterface x) => x -> IDynamic
+ Data.TCache.IDynamic: unsafeFromIDyn :: (DynamicInterface x) => IDynamic -> x
+ Data.TCache.IResource: Resources :: [a] -> [a] -> b -> Resources a b
+ Data.TCache.IResource: Retry :: Resources a b
+ Data.TCache.IResource: class IResource a
+ Data.TCache.IResource: data Resources a b
+ Data.TCache.IResource: defPath :: (IResource a) => a -> String
+ Data.TCache.IResource: delResource :: (IResource a) => a -> IO ()
+ Data.TCache.IResource: deserialize :: (IResource a) => String -> a
+ Data.TCache.IResource: keyResource :: (IResource a) => a -> String
+ Data.TCache.IResource: readResource :: (IResource a) => a -> IO (Maybe a)
+ Data.TCache.IResource: resources :: Resources a ()
+ Data.TCache.IResource: serialize :: (IResource a) => a -> String
+ Data.TCache.IResource: toAdd :: Resources a b -> [a]
+ Data.TCache.IResource: toDelete :: Resources a b -> [a]
+ Data.TCache.IResource: toReturn :: Resources a b -> b
+ Data.TCache.IResource: treadp :: (IResource a) => ST a
+ Data.TCache.IResource: tshowp :: (IResource a) => a -> ST String
+ Data.TCache.IResource: type AccessTime = Integer
+ Data.TCache.IResource: type ModifTime = Integer
+ Data.TCache.IResource: writeResource :: (IResource a) => a -> IO ()
+ Data.TCache.TMVar: Resources :: [a] -> [a] -> b -> Resources a b
+ Data.TCache.TMVar: Retry :: Resources a b
+ Data.TCache.TMVar: class IResource a
+ Data.TCache.TMVar: clearSyncCacheProc :: (IResource a) => Cache a -> Int -> (Integer -> Integer -> Integer -> Bool) -> Int -> IO ThreadId
+ Data.TCache.TMVar: data Resources a b
+ Data.TCache.TMVar: defPath :: (IResource a) => a -> String
+ Data.TCache.TMVar: defaultCheck :: Integer -> Integer -> Integer -> Bool
+ Data.TCache.TMVar: delResource :: (IResource a) => a -> IO ()
+ Data.TCache.TMVar: deleteResource :: (IResource a) => a -> IO ()
+ Data.TCache.TMVar: deleteResources :: (IResource a) => [a] -> IO ()
+ Data.TCache.TMVar: deserialize :: (IResource a) => String -> a
+ Data.TCache.TMVar: getResource :: (IResource a) => a -> IO (Maybe a)
+ Data.TCache.TMVar: getResources :: (IResource a) => [a] -> IO [Maybe a]
+ Data.TCache.TMVar: getTMVars :: (IResource a) => [a] -> STM [Maybe (TMVar a)]
+ Data.TCache.TMVar: getTMVarsIO :: (IResource a) => [a] -> IO [TMVar a]
+ Data.TCache.TMVar: keyResource :: (IResource a) => a -> String
+ Data.TCache.TMVar: newCache :: IO (Ht a, Integer)
+ Data.TCache.TMVar: readFileStrict :: FilePath -> IO [Char]
+ Data.TCache.TMVar: readResource :: (IResource a) => a -> IO (Maybe a)
+ Data.TCache.TMVar: refcache :: Cache a
+ Data.TCache.TMVar: resources :: Resources a ()
+ Data.TCache.TMVar: serialize :: (IResource a) => a -> String
+ Data.TCache.TMVar: setCache :: (Ht a, Integer) -> IO ()
+ Data.TCache.TMVar: syncCache :: (IResource a) => IORef (HashTable String (Block a), Integer) -> IO ()
+ Data.TCache.TMVar: toAdd :: Resources a b -> [a]
+ Data.TCache.TMVar: toDelete :: Resources a b -> [a]
+ Data.TCache.TMVar: toReturn :: Resources a b -> b
+ Data.TCache.TMVar: treadp :: (IResource a) => ST a
+ Data.TCache.TMVar: tshowp :: (IResource a) => a -> ST String
+ Data.TCache.TMVar: type Cache a = IORef (Ht a, Integer)
+ Data.TCache.TMVar: withResource :: (IResource a) => a -> (Maybe a -> a) -> IO ()
+ Data.TCache.TMVar: withResources :: (IResource a) => [a] -> ([Maybe a] -> [a]) -> IO ()
+ Data.TCache.TMVar: withSTMResources :: (IResource a) => [a] -> ([Maybe a] -> Resources a x) -> STM x
+ Data.TCache.TMVar: writeResource :: (IResource a) => a -> IO ()
+ Data.TCache.TMVar.Dynamic: IDynamic :: a -> IDynamic
+ Data.TCache.TMVar.Dynamic: Key :: TypeRep -> String -> Key
+ Data.TCache.TMVar.Dynamic: Resources :: [a] -> [a] -> b -> Resources a b
+ Data.TCache.TMVar.Dynamic: Retry :: Resources a b
+ Data.TCache.TMVar.Dynamic: class DynamicInterface x
+ Data.TCache.TMVar.Dynamic: class IResource a
+ Data.TCache.TMVar.Dynamic: clearSyncCacheProc :: Int -> (Integer -> Integer -> Integer -> Bool) -> Int -> IO ThreadId
+ Data.TCache.TMVar.Dynamic: data IDynamic
+ Data.TCache.TMVar.Dynamic: data Key
+ Data.TCache.TMVar.Dynamic: data Resources a b
+ Data.TCache.TMVar.Dynamic: defPath :: (IResource a) => a -> String
+ Data.TCache.TMVar.Dynamic: defaultCheck :: Integer -> Integer -> Integer -> Bool
+ Data.TCache.TMVar.Dynamic: delResource :: (IResource a) => a -> IO ()
+ Data.TCache.TMVar.Dynamic: deleteDResource :: IDynamic -> IO ()
+ Data.TCache.TMVar.Dynamic: deleteDResources :: [IDynamic] -> IO ()
+ Data.TCache.TMVar.Dynamic: deleteResource :: (Typeable a, IResource a) => a -> IO ()
+ Data.TCache.TMVar.Dynamic: deleteResources :: (Typeable a, IResource a) => [a] -> IO ()
+ Data.TCache.TMVar.Dynamic: deserialize :: (IResource a) => String -> a
+ Data.TCache.TMVar.Dynamic: fromIDyn :: (DynamicInterface x) => IDynamic -> x
+ Data.TCache.TMVar.Dynamic: getDResource :: IDynamic -> IO (Maybe IDynamic)
+ Data.TCache.TMVar.Dynamic: getDResources :: [IDynamic] -> IO [Maybe IDynamic]
+ Data.TCache.TMVar.Dynamic: getResource :: (Typeable a, Typeable b, IResource a, IResource b) => a -> IO (Maybe b)
+ Data.TCache.TMVar.Dynamic: getResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> IO [Maybe b]
+ Data.TCache.TMVar.Dynamic: getTMVars :: [IDynamic] -> STM [Maybe (TMVar IDynamic)]
+ Data.TCache.TMVar.Dynamic: getTMVarsIO :: [IDynamic] -> IO [TMVar IDynamic]
+ Data.TCache.TMVar.Dynamic: keyResource :: (IResource a) => a -> String
+ Data.TCache.TMVar.Dynamic: readFileStrict :: FilePath -> IO [Char]
+ Data.TCache.TMVar.Dynamic: readResource :: (IResource a) => a -> IO (Maybe a)
+ Data.TCache.TMVar.Dynamic: refcache :: Cache a
+ Data.TCache.TMVar.Dynamic: registerType :: (DynamicInterface x) => IO x
+ Data.TCache.TMVar.Dynamic: resources :: Resources a ()
+ Data.TCache.TMVar.Dynamic: serialize :: (IResource a) => a -> String
+ Data.TCache.TMVar.Dynamic: setCache :: (Ht a, Integer) -> IO ()
+ Data.TCache.TMVar.Dynamic: syncCache :: IO ()
+ Data.TCache.TMVar.Dynamic: toAdd :: Resources a b -> [a]
+ Data.TCache.TMVar.Dynamic: toDelete :: Resources a b -> [a]
+ Data.TCache.TMVar.Dynamic: toIDyn :: (DynamicInterface x) => x -> IDynamic
+ Data.TCache.TMVar.Dynamic: toReturn :: Resources a b -> b
+ Data.TCache.TMVar.Dynamic: treadp :: (IResource a) => ST a
+ Data.TCache.TMVar.Dynamic: tshowp :: (IResource a) => a -> ST String
+ Data.TCache.TMVar.Dynamic: type Cache a = IORef (Ht a, Integer)
+ Data.TCache.TMVar.Dynamic: unsafeFromIDyn :: (DynamicInterface x) => IDynamic -> x
+ Data.TCache.TMVar.Dynamic: withDResource :: IDynamic -> (Maybe IDynamic -> IDynamic) -> IO ()
+ Data.TCache.TMVar.Dynamic: withDResources :: [IDynamic] -> ([Maybe IDynamic] -> [IDynamic]) -> IO ()
+ Data.TCache.TMVar.Dynamic: withDSTMResources :: [IDynamic] -> ([Maybe IDynamic] -> Resources IDynamic x) -> STM x
+ Data.TCache.TMVar.Dynamic: withResource :: (Typeable a, Typeable b, IResource a, IResource b) => a -> (Maybe a -> b) -> IO ()
+ Data.TCache.TMVar.Dynamic: withResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> ([Maybe a] -> [b]) -> IO ()
+ Data.TCache.TMVar.Dynamic: withSTMResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> ([Maybe a] -> Resources b x) -> STM x
+ Data.TCache.TMVar.Dynamic: writeResource :: (IResource a) => a -> IO ()
- Data.TCache: getTVars :: (IResource a) => [a] -> IO [Maybe (TVar a)]
+ Data.TCache: getTVars :: (IResource a) => [a] -> STM [Maybe (TVar a)]
- Data.TCache: setCache :: Cache a -> IO ()
+ Data.TCache: setCache :: (Ht a, Integer) -> IO ()
- Data.TCache: syncCache :: (IResource a) => IORef (HashTable String (Block a), t) -> IO ()
+ Data.TCache: syncCache :: (IResource a) => Cache a -> IO ()
- Data.TCache.Dynamic: Key :: String -> Key
+ Data.TCache.Dynamic: Key :: TypeRep -> String -> Key
- Data.TCache.Dynamic: getResource :: (Typeable a, IResource a) => a -> IO (Maybe a)
+ Data.TCache.Dynamic: getResource :: (Typeable a, Typeable b, IResource a, IResource b) => a -> IO (Maybe b)
- Data.TCache.Dynamic: getResources :: (Typeable a, IResource a) => [a] -> IO [Maybe a]
+ Data.TCache.Dynamic: getResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> IO [Maybe b]
- Data.TCache.Dynamic: setCache :: Cache a -> IO ()
+ Data.TCache.Dynamic: setCache :: (Ht a, Integer) -> IO ()
- Data.TCache.Dynamic: withResource :: (Typeable a, IResource a) => a -> (Maybe a -> a) -> IO ()
+ Data.TCache.Dynamic: withResource :: (Typeable a, Typeable b, IResource a, IResource b) => a -> (Maybe a -> b) -> IO ()
- Data.TCache.Dynamic: withResources :: (Typeable a, IResource a) => [a] -> ([Maybe a] -> [a]) -> IO ()
+ Data.TCache.Dynamic: withResources :: (Typeable a, Typeable b, IResource a, IResource b) => [a] -> ([Maybe a] -> [b]) -> IO ()
Files
- Data/TCache.hs +233/−239
- Data/TCache/Dynamic.hs +144/−139
- Data/TCache/Dynamic2.hs +0/−198
- Data/TCache/IDynamic.hs +159/−0
- Data/TCache/IResource.hs +190/−0
- Data/TCache/TMVar.hs +378/−0
- Data/TCache/TMVar/Dynamic.hs +183/−0
- DynamicSample.hs +0/−56
- IDE.session +15/−0
- Sample.hs +0/−101
- Sample2.hs +0/−91
- TCache.cabal +41/−27
- demos/DynamicSample.hs +71/−0
- demos/Sample.hs +102/−0
- demos/Sample2.hs +67/−0
- dist/build/autogen/Paths_TCache.hs +29/−0
- dist/build/autogen/cabal_macros.h +38/−0
- dist/doc/html/TCache/Data-TCache-Dynamic.html +2627/−0
- dist/doc/html/TCache/Data-TCache-IDynamic.html +672/−0
- dist/doc/html/TCache/Data-TCache-IResource.html +844/−0
- dist/doc/html/TCache/Data-TCache-TMVar-Dynamic.html +2232/−0
- dist/doc/html/TCache/Data-TCache-TMVar.html +1463/−0
- dist/doc/html/TCache/Data-TCache.html +1803/−0
- dist/doc/html/TCache/TCache.haddock binary
- dist/doc/html/TCache/doc-index.html +1166/−0
- dist/doc/html/TCache/frames.html +27/−0
- dist/doc/html/TCache/haddock-util.js +139/−0
- dist/doc/html/TCache/haddock.css +297/−0
- dist/doc/html/TCache/haskell_icon.gif binary
- dist/doc/html/TCache/index-frames.html +37/−0
- dist/doc/html/TCache/index.html +211/−0
- dist/doc/html/TCache/mini_Data-TCache-Dynamic.html +149/−0
- dist/doc/html/TCache/mini_Data-TCache-IDynamic.html +43/−0
- dist/doc/html/TCache/mini_Data-TCache-IResource.html +49/−0
- dist/doc/html/TCache/mini_Data-TCache-TMVar-Dynamic.html +137/−0
- dist/doc/html/TCache/mini_Data-TCache-TMVar.html +87/−0
- dist/doc/html/TCache/mini_Data-TCache.html +107/−0
- dist/doc/html/TCache/minus.gif binary
- dist/doc/html/TCache/plus.gif binary
- dist/setup-config +2/−0
Data/TCache.hs view
@@ -1,12 +1,11 @@-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} +{-# OPTIONS -fglasgow-exts -XUndecidableInstances #-} ------------------------------------------------- -- A Transactional data cache with configurable persitence -- (Something like a little Java Hybernate or Rails for Rubi) --- Author: Alberto Gómez Corona Nov 2006 +-- Author: Alberto G�mez Corona Nov 2006 -- Language: Haskell --- Version: 0.5 -- Terms of use: See LICENSE -- 2008: -- some bugs fixed @@ -25,26 +24,28 @@ IResource(..) -- class interface to be implemented for the object by the user -,Operation (Insert,Delete) -- data definition used to communicate object Inserts and Deletes to the cache - -,Cache -- :: IORef (Ht a,Int, Integer) --The cache definition -- ,setCache -- :: Cache a -> IO() -- set the cache. this is useful for hot loaded modules that will use an existing cache +,Resources(..) -- data definition used to communicate object Inserts and Deletes to the cache +,resources -- empty resources ,getTVars -- :: (IResource a)=> [a] -- the list of resources to be retrieved- -- -> IO [Maybe (TVar a)] -- The Transactional variables (See Data.TVar documentation)- -,withResourcesID -- :: (IResource a)=> [a]-> --list of resources to be extracted for the user function - -- ([Maybe a]->[Operation a]) --user function that get the retrieved resources - -- ->IO () --and return a list of objects to be inserted/modified or deleted + -- -> IO [Maybe (TVar a)] -- The Transactional variables++,releaseTVars+ +,getTVarsIO -- :: (IResource a)=> [a] -> IO [TVar a] + +,withSTMResources -- :: (IResource a)=> [a] -- list of resources to retrieve + -- -> ([Maybe a]-> Resources a x) -- the function to apply that contains a Resources structure + -- -> STM x -- return value within the STM monad + ,withResources -- :: (IResource a)=> [a] --list of resources to be retrieve - -- ->([Maybe a]->[a]) ----function that get the retrieved resources - -- ->IO () --and return a list of objects to be inserted/modified + -- -> ([Maybe a]-> [a]) ----function that get the retrieved resources + -- -> IO () --and return a list of objects to be inserted/modified ,withResource -- :: (IResource a)=> a --same as withResources , but for one only object - -- ->([Maybe a]->a) -- - -- ->IO () -- + -- -> ([Maybe a]-> a) -- + -- -> IO () -- ,getResources -- :: (IResource a)=>[a] --resources [a] are read from cache and returned -- -> IO [Maybe a] @@ -54,8 +55,15 @@ ,deleteResources -- :: (IResource a)=>[a]-> IO() -- delete the list of resources from cache and from persistent storage ,deleteResource -- :: (IResource a)=>a-> IO() -- delete the resource from cache and from persistent storage + + --cache handling +,Cache -- :: IORef (Ht a,Int, Integer) --The cache definition +,setCache -- :: Cache a -> IO() -- set the cache. this is useful for hot loaded modules that will use an existing cache + +,newCache -- :: (Ht a, Integer) --newCache creates a new cache + ,refcache -- :: Cache a --the reference to the cache (see data definition below) ,syncCache -- :: (IResource a) =>Cache a -> IO() --force the atomic write of all the cache objects into permanent storage @@ -64,16 +72,16 @@ --start the thread that clean and writes on the persistent storage trough syncCache ,clearSyncCacheProc -- :: (IResource a) =>Cache a --The cache reference -- -> Int --number of seconds betwen checks - -- -> (Integer->Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object + -- -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object --(when True, the object is removed from cache) -- -> Int --The max number of objects in the cache, if more, the cleanup start -- -> >IO ThreadId --Identifier of the thread created -- the default check procedure ,defaultCheck -- :: Integer -- current time in seconds - -- ->Integer --last access time for a given object - -- ->Integer --last cache syncronization (with the persisten storage) - -- ->Bool --return true for all the elems not accesed since + -- -> Integer --last access time for a given object + -- -> Integer --last cache syncronization (with the persisten storage) + -- -> Bool --return true for all the elems not accesed since --half the time between now and the last sync -- auxiliary @@ -83,223 +91,205 @@ ) where + import GHC.Conc -import Control.Exception as Exception -import Control.Concurrent+import Control.Concurrent.STM.TMVar import Control.Monad(when) import Data.HashTable as H import Data.IORef -import System.IO -import System.IO.Unsafe-import System.IO.Error +import System.IO.Unsafe import System.Time import Data.Maybe(catMaybes,mapMaybe) -import Debug.Trace -import System.Directory-import Data.List(elemIndices) - -debug1 a b= trace b a - - -type Key= String-+import Data.TCache.IResource +import Control.Exception(handle,assert) --- Interface that must be defined for every object being cached --- readResource and writeResource implemented by default as read/write files with its key as filename --- serialize and deserialize are specified just to allow these defaults-- -class IResource a where - serialize :: a -> String- deserialize :: String -> a- keyResource :: a -> String- - defPath :: a-> String --additional extension for default file paths or key prefixes - defPath _ = "" - -- get object content from the file - -- (NOTE: reads and writes can't collide, so they-- Not really needed since no write is done while read- -- must be strict, not lazy )- readResource :: a->IO (Maybe a) - readResource x=handleJust Exception.ioErrors (handle x) $ do - s::String <- readFileStrict filename --`debug` ("read "++filename) - return $ Just $ deserialize s- where- filename= defPath x++ keyResource x- handle :: a -> IOError -> IO (Maybe a)- handle x e- |isAlreadyInUseError e = readResource x -- maybe is being written. try again. - - | isDoesNotExistError e = return Nothing- | isPermissionError e = error $ "no permissions for opening file: "++filename- | otherwise= error $ "unspecified error: " ++ show e - - writeResource:: a->IO() - writeResource x= handleJust Exception.ioErrors (handle x) $ writeFile filename (serialize x) --`debug` ("write "++filename) - where- filename= (defPath x ++ keyResource x)- handle :: a -> IOError -> IO ()- handle x e- | isDoesNotExistError e=do- createDirectoryIfMissing True $ take (1+(last $ elemIndices '/' filename)) filename --maybe the path does not exist- writeResource x - | isAlreadyInUseError e= writeResource x -- maybe is being read. try again- -- Not really needed since no write is done while read- | isPermissionError e = error $ "no permissions for writing file: "++ filename - - | otherwise= error $ show e - - delResource:: a->IO() - delResource x= handleJust Exception.ioErrors (handle x) $ removeFile $ defPath x ++ keyResource x- where- handle :: a -> IOError -> IO ()- handle x e- | isDoesNotExistError e= return ()- | otherwise = error (show e)- --- to allow not only inserts but also deletes -data Operation b= Insert b | Delete b - - -type AccessTime= Integer -type ModifTime = Integer - type Block a= (TVar a,AccessTime,ModifTime) type Ht a= HashTable String (Block a) -- contains the hastable, number of items, last sync time type Cache a= IORef (Ht a, Integer) data CheckBlockFlags= AddToHash | NoAddToHash | MaxTime --- the cache holder -ref2cache :: IORef (Maybe (Cache a))-ref2cache= unsafePerformIO $ newIORef Nothing --- set the cache. this is useful for hot loaded modules that will update an existing cache-setCache :: Cache a -> IO()-setCache ch= writeIORef ref2cache $ Just ch+-- |set the cache. this is useful for hot loaded modules that will update an existing cache. Experimental+setCache :: (Ht a, Integer) -> IO()+setCache = writeIORef refcache +-- the cache holder. stablished by default refcache :: Cache a -refcache =unsafePerformIO $do- n <- readIORef ref2cache- case n of- Nothing -> do - c <- H.new (==) hashString - newIORef (c,0) - Just ch -> return ch +refcache =unsafePerformIO $ newCache >>= newIORef + +-- | newCache creates a new cache. Experimental +newCache :: IO (Ht a, Integer) +newCache =do + c <- H.new (==) hashString + return (c,0) -getTVars :: (IResource a)=> [a] -> IO [Maybe (TVar a)]+-- | getTVars return the TVar that wraps the resources for which the keys are given . +-- | it return @Nothing@ if a TVar with this object has not been allocated +-- These TVars can be used as usual in explicit user constructed atomic blocks +-- Additionally, the retrieved TVars remain in the cache and can be accessed and updated by the rest +-- of the TCache methods. +-- to keep the consistence in the serialized data, the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called + +getTVars+ :: (IResource a)+ => [a] -- ^ the list of partial object definitions for which keyResource can be extracted+ -> STM [Maybe (TVar a)] -- ^ The TVars that contain such objects getTVars rs= do- (cache,_) <- readIORef refcache + (cache,_) <- unsafeIOToSTM $ readIORef refcache takeBlocks rs cache MaxTime - -withResourcesID:: (IResource a)=> [a]->([Maybe a]->[Operation a])->IO () -withResourcesID rs f= do - (cache,_) <- readIORef refcache - mtrs <- takeBlocks rs cache NoAddToHash - idrs <- atomically $ do - mrs <- mapM mreadTVar mtrs - let idrs= f mrs - let ladd= map selectAdd idrs - releaseBlocks (catMaybes ladd) cache - return idrs - let ldel= map selectDelete idrs - let ldel1= catMaybes ldel - mapM delResource ldel1 - delListFromHash cache $ map keyResource ldel1 - - return () +-- | releaseTVars permits the TVars captured by getTVars to be released. so they can be discarded when not used. +-- Do this when you no longer need to use them directly in atomic blocks. +releaseTVars :: (IResource a)=> [a]-> STM () +releaseTVars rs=do + (cache,_) <- unsafeIOToSTM $ readIORef refcache + releaseBlocks rs cache + +-- | getTVarsIO does not search for a TVar in the cache like getTVars. Instead of this getTVarsIO creates a list of +-- TVars with the content given in the list of resourcees and add these TVars to the cache and return them. +-- the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called +getTVarsIO :: (IResource a)=> [a] -> IO [TVar a] +getTVarsIO rs= do + tvs<- mapM newTVarIO rs + (cache,_) <- readIORef refcache + mapM_ (\(tv,r)-> H.update cache (keyResource r) (tv, infinite, infinite)) $ zip tvs rs + return tvs - where - selectDelete (Insert a)= Nothing - selectDelete (Delete a)= Just a - - selectAdd (Insert a)= Just a - selectAdd (Delete a)= Nothing - -mreadTVar (Just tvar)= do r <-readTVar tvar - return $ Just r -mreadTVar Nothing = return Nothing - - +-- | this is the main function for the *Resource calls. All the rest derive from it. The results are kept in the STM monad+-- so it can be part of a larger STM transaction involving other TVars+-- The 'Resources' register returned by the user-defined function is interpreted as such:+-- +-- 'toAdd': additional resources not read in the first parameter of withSTMResources are created/updated with toAdd +--+-- 'toDelete': from the cache and from permanent storage+-- +-- 'toReturn': will be returned by withSTMResources + +withSTMResources :: (IResource a)=> [a] -- ^ the list of resources to be retrieved + -> ([Maybe a]-> Resources a x) -- ^ The function that process the resources found and return a Resources structure + -> STM x -- ^ The return value in the STM monad. +withSTMResources rs f= do + (cache,_) <- unsafeIOToSTM $ readIORef refcache + mtrs <- takeBlocks rs cache AddToHash + + mrs <- mapM mreadTVar mtrs + case f mrs of+ Retry -> retry+ Resources as ds r -> do + unsafeIOToSTM $ do+ delListFromHash cache $ map keyResource ds+ mapM delResource ds + releaseBlocks as cache + return r + + where + assert1= flip assert -withResource:: (IResource a)=> a->(Maybe a->a)->IO () + mreadTVar (Just tvar)= readTVar tvar >>= return . Just + mreadTVar Nothing = return Nothing + + +-- | update of a single object in the cache+--+-- @withResource r f= withResources [r] (\[mr]-> [f mr])@ +withResource:: (IResource a)+ => a -- ^ prototypes of the object to be retrieved for which keyResource can be derived+ -> (Maybe a-> a) -- ^ update function that return another full object+ -> IO () withResource r f= withResources [r] (\[mr]-> [f mr]) +-- | to atomically add/modify many objects in the cache+-- +-- @ withResources rs f= atomically $ withSTMResources rs f1 >> return() where f1 mrs= let as= f mrs in Resources as [] ()@+withResources:: (IResource a)=> [a]-> ([Maybe a]-> [a])-> IO () +withResources rs f= atomically $ withSTMResources rs f1 >> return() where + f1 mrs= let as= f mrs in Resources as [] ()+ +-- | to read a resource from the cache.+--+-- @getResource r= do{mr<- getResources [r];return $! head mr}@+getResource:: (IResource a)=>a-> IO (Maybe a) +getResource r= do{mr<- getResources [r];return $! head mr} --withResources:: (IResource a)=> [a]->([Maybe a]->[a])->IO () -withResources rs f= do - (cache,_) <- readIORef refcache - mtrs <- takeBlocks rs cache NoAddToHash - - - atomically $ do - - mrs <- mapM mreadTVar mtrs - let rs'= f mrs - releaseBlocks rs' cache - - return () +--- | to read a list of resources from the cache if they exist+-- +-- | @getResources rs= atomically $ withSTMResources rs f1 where f1 mrs= Resources [] [] mrs@ +getResources:: (IResource a)=>[a]-> IO [Maybe a] +getResources rs= atomically $ withSTMResources rs f1 where + f1 mrs= Resources [] [] mrs + + +-- | delete the resource from cache and from persistent storage.+--+-- @ deleteResource r= deleteResources [r] @+deleteResource :: IResource a => a -> IO () +deleteResource r= deleteResources [r] + +-- | delete the list of resources from cache and from persistent storage.+-- +-- @ deleteResources rs= atomically $ withSTMResources rs f1 where f1 mrs = Resources [] (catMaybes mrs) ()@ +deleteResources :: IResource a => [a] -> IO ()+deleteResources rs= atomically $ withSTMResources rs f1 where + f1 mrs = Resources [] (catMaybes mrs) () + + -takeBlocks :: (IResource a)=> [a] -> Ht a -> CheckBlockFlags ->IO [Maybe (TVar a)]+takeBlocks :: (IResource a)=> [a] -> Ht a -> CheckBlockFlags -> STM [Maybe (TVar a)] takeBlocks rs cache addToHash= mapM (checkBlock cache addToHash) rs where- checkBlock :: IResource a => Ht a -> CheckBlockFlags -> a-> IO(Maybe (TVar a)) + checkBlock :: IResource a => Ht a -> CheckBlockFlags -> a-> STM(Maybe (TVar a)) checkBlock cache flags r =do - c <- H.lookup cache keyr + c <- unsafeIOToSTM $ H.lookup cache keyr case c of Nothing -> do - mr <- readResource r -- `debug1` ("read "++keyr++ " hash= "++ (show $ H.hashString keyr)) + mr <- unsafeIOToSTM $ readResource r -- `debug` ("read "++keyr++ " hash= "++ (show $ H.hashString keyr)) case mr of Nothing -> return Nothing Just r2 -> do - tvr <- atomically $ newTVar r2 + tvr <- newTVar r2 case flags of NoAddToHash -> return $ Just tvr AddToHash -> do - ti <- timeInteger - H.update cache keyr (tvr, ti, 0) -- accesed, not modified - return $ Just tvr + ti <- unsafeIOToSTM timeInteger + unsafeIOToSTM $ H.update cache keyr (tvr, ti, 0) -- accesed, not modified + return $ Just tvr MaxTime -> do - ti <- timeInteger - let maxtime= ti + 1000000000- H.update cache keyr (tvr, maxtime, maxtime) -- accesed, not modified + unsafeIOToSTM $ H.update cache keyr (tvr, infinite, infinite) -- accesed, not modified return $ Just tvr- + Just(tvr,_,_) -> return $ Just tvr where keyr= keyResource r -releaseTVars :: (IResource a)=> [a]-> IO()-releaseTVars rs=do- (cache,_) <- readIORef refcache - atomically $ releaseBlocks rs cache- -releaseBlocks :: (IResource a)=> [a] -> Ht a ->STM ()+ +releaseBlocks :: (IResource a)=> [a] -> Ht a -> STM () releaseBlocks rs cache = mapM_ checkBlock rs where checkBlock r =do c <- unsafeIOToSTM $ H.lookup cache keyr case c of - Nothing -> do tvr <- newTVar r - ti <- unsafeIOToSTM timeInteger - unsafeIOToSTM $ H.update cache keyr (tvr, ti, ti ) -- accesed and modified XXX + Nothing -> do+ tvr <- newTVar r+ ti <- unsafeIOToSTM timeInteger+ unsafeIOToSTM $ H.update cache keyr (tvr, ti, ti ) -- accesed and modified XXX - Just(tvr,_,tm) ->do writeTVar tvr r - ti <- unsafeIOToSTM timeInteger - let t= max ti tm - unsafeIOToSTM $ H.update cache keyr (tvr ,t,t) + Just(tvr,_,tm) -> do+ writeTVar tvr r + ti <- unsafeIOToSTM timeInteger+ let t= max ti tm+ unsafeIOToSTM $ H.update cache keyr (tvr ,t,t) @@ -309,54 +299,71 @@ timeInteger= do TOD t _ <- getClockTime return t -getResource r= do{mr<-getResources [r];return $! head mr} -getResources:: (IResource a)=>[a]-> IO [Maybe a] -getResources rs= do - (cache,_) <- readIORef refcache - mtrs <- takeBlocks rs cache AddToHash - atomically $ mapM mreadTVar mtrs - -deleteResource r= deleteResources [r] -deleteResources rs=do - (cache,_) <- readIORef refcache - atomically $! do - unsafeIOToSTM $ mapM delResource rs - unsafeIOToSTM $ delListFromHash cache $ map keyResource rs - +delListFromHash hash l=mapM_ (delete hash) l +updateListToHash hash kv= mapM (update1 hash) kv where + update1 h (k,v)= update h k v -delListFromHash hash l= do{mapM (delete hash) l; return()} +{-| Cache handling -} -updateListToHash hash kv= do{mapM (update1 hash) kv; return()}where - update1 h (k,v)= update h k v +-- | Start the thread that clean and writes on the persistent storage. +-- Otherwise, clearSyncCache must be invoked explicitly or no persistence will exist +-- :: (IResource a) =>Cache a +-- -> Int --number of seconds betwen checks +-- -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object + --(when this function return True, the object is removed from cache) +-- -> Int --The max number of objects in the cache, if more, the cleanup start +-- -> >IO ThreadId --Identifier of the thread created ------------------------clear, sync cache------------- -clearSyncCacheProc ::(IResource a)=> Cache a->Int->(Integer -> Integer->Integer->Bool)->Int->IO ThreadId +clearSyncCacheProc ::+ (IResource a)+ => Cache a -- ^ The cache reference ('refcache' usually)+ -> Int -- ^ number of seconds betwen checks. objects not written to disk are written+ -> (Integer -> Integer-> Integer-> Bool) -- ^ The user-defined check-for-cleanup-from-cache for each object. 'defaultCheck' is an example+ -> Int -- ^ The max number of objects in the cache, if more, the cleanup starts+ -> IO ThreadId -- ^ Identifier of the thread created clearSyncCacheProc refcache time check sizeObjects= forkIO clear - where + where clear = do - threadDelay $ (fromIntegral$ time * 1000000) + threadDelay (fromIntegral$ time * 1000000) clearSyncCache refcache time check sizeObjects clear +saving= unsafePerformIO $ newTVarIO False +-- | Force the atomic write of all the cached objects into permanent storage +-- useful for termination+syncCache+ :: (IResource a)+ => Cache a -- ^ the cache reference ( 'refcache' usually)+ -> IO () +syncCache refcache = do+ atomically $ do+ s <- readTVar saving+ when s retry+ writeTVar saving True + (cache,t1) <- readIORef refcache + list <- toList cache + t2<- timeInteger + atomically $ save list t1 + writeIORef refcache (cache, t2) -syncCache refcache = do - (cache,_) <- readIORef refcache - list <- toList cache - atomically $ save list 0 --print $ "write to persistent storage finised: "++ show (length list)++ " objects" --- - saves the unsaved elems of the cache --- - delete some elems of the cache when the number of elems > sizeObjects --- - The deletion depends on the check criteria. defaultCheck is the one implemented -clearSyncCache ::(IResource a) => Cache a-> Int -> (Integer -> Integer->Integer-> Bool)-> Int -> IO () -clearSyncCache refcache time check sizeObjects=do +-- Saves the unsaved elems of the cache +-- delete some elems of the cache when the number of elems > sizeObjects +-- The deletion depends on the check criteria. defaultCheck is the one implemented +clearSyncCache ::(IResource a) => Cache a-> Int -> (Integer -> Integer-> Integer-> Bool)-> Int -> IO () +clearSyncCache refcache time check sizeObjects=do+ atomically $ do+ s <- readTVar saving+ when s retry+ writeTVar saving True (cache,lastSync) <- readIORef refcache - handle (\e->do{print e;return ()})$ do + handle (\e-> do{print e;return ()})$ do elems <- toList cache let size=length elems atomically $ save elems lastSync @@ -370,11 +377,16 @@ where check1 (_,lastAccess,_)=check t lastAccess lastSync - filter ::(String,Block a)->IO Int + filter ::(String,Block a)-> IO Int filter (k,e)= if check1 e then do{H.delete cache k;return 1} else return 0 ---to drop from the cache all the elems not accesed since half the time between now and the last sync -defaultCheck:: Integer -> Integer->Integer->Bool +-- | To drop from the cache all the elems not accesed since half the time between now and the last sync +-- ths is a default cache clearance procedure -- it is invoke when the cache size exceeds the defined in 'clearSyncCacheProc' +defaultCheck+ :: Integer -- ^ current time in seconds+ -> Integer -- ^ last access time for a given object+ -> Integer -- ^ last cache syncronization (with the persisten storage)+ -> Bool -- ^ return true for all the elems not accesed since half the time between now and the last sync defaultCheck now lastAccess lastSync | lastAccess > halftime = False | otherwise = True @@ -383,36 +395,18 @@ halftime= now- (now-lastSync) `div` 2 + save:: (IResource a) => [(String, Block a)]-> Integer-> STM () -save list lastSave= mapM_ save1 list --`debug1` "saving" +save list lastSave= do+ mapM_ save1 list -- `debug` ("saving "++ (show $ length list))+ writeTVar saving False where- save1 :: IResource a =>(String, Block a) -> STM() - save1(_, (tvr,_,modTime))= do - if modTime >= lastSave --`debug1` ("modTime="++show modTime++"lastSave="++show lastSave) - then do + save1 :: IResource a =>(String, Block a) -> STM() + save1(_, (tvr,_,modTime))= + when (modTime >= lastSave) $ do -- `debug` ("modTime="++show modTime++"lastSave="++show lastSave) r<- readTVar tvr - unsafeIOToSTM $! writeResource r --`debug1` ("saved " ++ keyResource r) - else return() - - - - - -readFileStrict f = do - h <- openFile f ReadMode - s <- hFileSize h - let n= fromIntegral s - str <- readn h n- hClose h - return str - - where - -- read n bytes from handle h - readn h 0= return "" - readn h n=do - str <- hGetContents h - -- force to read n elements - if (str !! (n-1))== '\x00' then return str else return str + unsafeIOToSTM $! writeResource r -- `debug` ("saved " ++ keyResource r) +
Data/TCache/Dynamic.hs view
@@ -1,156 +1,144 @@-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -fbang-patterns #-}+{-# OPTIONS -fglasgow-exts -XUndecidableInstances -XBangPatterns #-} --- Data.TCache.Dynamic:--- a dynamic interface for TCache- +{- | Data.TCache.Dynamic:+A dynamic interface for TCache so that mixed datatypes can be managed participating in a single transaction.+The objects are encapsulated in a 'IDynamic' datatype, that is d Dynamic type that is serializable and indexable++Dynamic present essentially the same methods than Data.TCache. The added functionality is the management+of IDynamic types. Any datatype that is instance of IResource and Typeable can be handled mixed with any other+datatype. TCache.Dynamic is essentially a TCache working with a single datatype: IDynamic that is indexable and+serializable. You don´t need to do anything special except to define Typeable besides the IResource instance for+your particular datatype. Also, before use, your datatype must be registered (with 'registerType', see example in the package).++there are basically two types of methods in this module:++ * @with(STM)Resource(s)@ calls: manage one single type of data, in the same way than the naked @Data.TCache@ module, Are the same than Data.TCache.+ The marsalling to and from IDynamic is managed internally. These calls do exactly the same than the TCache calls with the same name+these cals allows different modules to handle their particular kind of data without regard that it is being handled in the same cache with other datatypes.++ * @wthD(STM)Resource(s)@: are new, and handle the IDynamic type. The user must wrap your datatypes (with toIDyn) and unwap it (with fromIDyn)+ These call permts to handle arbitrary types at the same time and partticipate in transactions.++There is also a useful 'Key' object whose purpose is to retrieve any objecto fo any datatype by its sting key++Also the parameter @refcache@ has been dropped from the methods that used it (the syncronization methods)+-}+ module Data.TCache.Dynamic( T.IResource(..) -- from TCache- ,T.Operation(..)+ ,T.Resources(..)+ ,T.resources ,T.setCache ,T.refcache ,T.defaultCheck,T.readFileStrict ,IDynamic(..) -- serializable/indexable existential datatype ,T.Cache- ,DynamicInterface ( +++ ,DynamicInterface ( toIDyn -- :: x -> IDynamic- ,registerType -- :: x -> IO() + ,registerType -- :: x ,fromIDyn -- :: IDynamic -> x ,unsafeFromIDyn -- :: IDynamic -> x+ ,safeFromIDyn ---- :: IDynamic -> Maybe x )+ --,ofType ,Key(..) {- Key datatype can be used to read any object trough the Dynamic interface let key= <key of the object >- mst <- getDResource $ Key key+ mst <- getDResource $ Key (ofType :: Type) key case mst of- Nothing -> error $ "getResource: not found "++ key + Nothing -> error $ "getResource: not found "++ key Just (idyn) -> do let st = fromIDyn idyn :: <desired datatype> .... -} --- same access interface , this time for Dynamic type. See Data.TCache for their equivalent definitions-,getDTVars,withDResource, withDResources, withDResourcesID, getDResource, getDResources, deleteDResource, deleteDResources+-- same access interface than TCache , this time for handling the Dynamic type. See Data.TCache for their equivalent definitions+-- to use it you have to wrap (with toIDyn) and unwrap(with fromIDyn) your data in a IDynamic object+,getTVars, releaseTVars, getTVarsIO,withDResource, withDResources, withDSTMResources, getDResource, getDResources, deleteDResource, deleteDResources --- syncache has no parameters now (see Data.TCache.syncCache) +-- syncache has no parameters now (see Data.TCache.syncCache). ,syncCache -- Same than Data.TCache but without Cache parameter ,clearSyncCacheProc - --- the same interface for any datatype: -, withResource, withResources, withResourcesID, getResource, getResources, deleteResource, deleteResources + +-- the same interface for any datatype. wrapping and unwrapping are made internally.+--have the same functionalities than the Data.TCache primitives with the same name. +, withResource, withResources, withSTMResources, getResource, getResources, deleteResource, deleteResources ) where+ import System.IO.Unsafe-import Control.Concurrent.MVar import Data.Typeable-import Unsafe.Coerce import qualified Data.TCache as T+import Data.TCache.IDynamic as I import Debug.Trace-import Control.Concurrent.STM(TVar)-import Unsafe.Coerce-+import Control.Concurrent.STM(atomically,STM)+import Control.Concurrent.STM.TVar+import Control.Concurrent(forkIO)+import Control.Exception(finally)+import Data.TCache.IDynamic+import Control.Concurrent(ThreadId)+debug a b= trace b a +-- | handles Dynamic objects using @Data.TCache.withResource@+--+-- @withDResource = Data.TCache..withResource @ +withDResource :: IDynamic-> (Maybe IDynamic-> IDynamic)-> IO () +withDResource = T.withResource -debug a b= trace b a +-- | @withDResources = Data.TCache.withResources@ +withDResources:: [IDynamic]-> ([Maybe IDynamic]-> [IDynamic])-> IO () +withDResources = T.withResources -data IDynamic= forall a. (Typeable a, T.IResource a) => IDynamic a deriving Typeable+-- | this is the main function for the *Resource calls. All the rest derive from it. The results are kept in the STM monad+-- so it can be part of a larger STM transaction involving other TVars+-- The @Resources@ register returned by the user-defined function is interpreted as such:+-- +-- @toAdd@: additional resources not read in the first parameter of withSTMResources are created/updated with toAdd +--+-- @toDelete@: from the cache and from permanent storage+-- +-- @toReturn@: will be returned by withSTMResources +withDSTMResources+ :: [IDynamic] -- ^ The list of resources to be retrieved+ -> ([Maybe IDynamic] -> T.Resources IDynamic x) -- ^ The function that process the resources found and return a Resources structure+ -> STM x -- ^ The return value in the STM monad. +withDSTMResources = T.withSTMResources +-- | @getDResource = Data.TCache.getResource@ +getDResource :: IDynamic -> IO (Maybe IDynamic) +getDResource = T.getResource +-- | @getDResources = Data.TCache.getResources@ +getDResources :: [IDynamic] -> IO [Maybe IDynamic] +getDResources = T.getResources -type Deserializer = (String, (String -> IDynamic ))-list :: MVar [fromStringr]+-- | getTVars return the TVar that wraps the resources for which the keys are given . +-- | it return @Nothing@ if a TVar with this object has not been allocated +-- These TVars can be used as usual in explicit user constructed atomic blocks +-- Additionally, the retrieved TVars remain in the cache and can be accessed and updated by the rest +-- of the TCache methods. +-- to keep the consistence in the serialized data, the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called +-- See 'Data.TCache.getTVars'+getTVars :: [IDynamic] -> STM [Maybe (TVar IDynamic)]+getTVars= T.getTVars -list = unsafePerformIO $ newMVar [] +releaseTVars :: [IDynamic] -> STM ()+releaseTVars= T.releaseTVars -instance T.IResource IDynamic where- keyResource (IDynamic x)= T.keyResource x- defPath (IDynamic x)= T.defPath x- serialize (IDynamic x)= show (typeOf x) ++ "\n"++ T.serialize x- deserialize str= case lookup key (unsafePerformIO $ readMVar list) of- Nothing -> error $ "not registered type "++key++" please registerType it"- Just f -> f (tail objstr) - - where- (key, objstr)= span (/='\n') str+getTVarsIO :: [IDynamic] -> IO [TVar IDynamic]+getTVarsIO= T.getTVarsIO -instance Show IDynamic where- show (IDynamic x)= "(IDynamic \""++show (typeOf x) ++"\" "++ T.serialize x++")"- --class DynamicInterface x where - toIDyn :: x -> IDynamic- registerType :: IO x- fromIDyn :: IDynamic -> x- unsafeFromIDyn :: IDynamic -> x- -- get(toIDyn x)== x--instance (T.IResource x,Typeable x) => DynamicInterface x where- toIDyn x= IDynamic x- - registerType = do- let x= unsafeCoerce 1 :: x- let f= T.deserialize :: (String -> x) - let f1 s= IDynamic (f s) - l <- takeMVar list- case lookup (strType x) l of- Just _ -> do- putMVar list l- return x- _ -> do- putMVar list $ (strType x ,f1):l- return x- where- strType x= show $ typeOf x- - fromIDyn d@(IDynamic a)= if type2 == type1 then v- else error ("fromIDyn: casting "++ show type1 ++" to type "++show type2 ++" for data "++ T.serialize a)- where - v= unsafeCoerce a :: x- type1= typeOf a- type2= typeOf v- - unsafeFromIDyn (IDynamic a)= unsafeCoerce a- -{- Key datatype can be used to read any object trough the Dynamic interface-- let key= <key of the object >- mst <- getDResource $ Key key- case mst of- Nothing -> error $ "getResource: not found "++ key - Just (idyn) -> do- let st = fromIDyn idyn :: <desired datatype>--}--data Key= Key String deriving Typeable-instance T.IResource Key where- keyResource (Key k)=k- serialize (Key x)= x- deserialize str= Key str -withDResource :: IDynamic->(Maybe IDynamic->IDynamic)->IO () -withDResource = T.withResource - -withDResources:: [IDynamic]->([Maybe IDynamic]->[IDynamic])->IO () -withDResources = T.withResources -withDResourcesID :: [IDynamic]->([Maybe IDynamic]->[T.Operation IDynamic])->IO () -withDResourcesID = T.withResourcesID - -getDResource :: IDynamic -> IO (Maybe IDynamic) -getDResource = T.getResource - -getDResources :: [IDynamic] -> IO [Maybe IDynamic] -getDResources = T.getResources --getDTVars :: [IDynamic] -> IO [Maybe (TVar IDynamic)]-getDTVars= T.getTVars- --- return error if any resource is not found +-- | retrieve a list of objects and return error if any resource is not found. instead of Nothing justGetDResources rs=do mrs <- getDResources rs return $ map process $ zip mrs rs where @@ -161,61 +149,78 @@ return r' - +-- | delete a resource from the cache and the storage deleteDResource :: IDynamic -> IO () deleteDResource= T.deleteResource +-- | delete a list of resources from the cache and the storage deleteDResources :: [IDynamic] -> IO () deleteDResources= T.deleteResources - ++-- syncronize the cache with the permanent storage+syncCache :: IO () syncCache= T.syncCache (T.refcache :: T.Cache IDynamic) - - +-- | Start the thread that clean and writes on the persistent storage. +-- Otherwise, syncCache must be invoked explicitly or no persistence will exist +clearSyncCacheProc+ :: Int -- ^ number of seconds betwen checks. objects not written to disk are written+ -> (Integer -> Integer-> Integer-> Bool) -- ^ The user-defined check-for-cleanup-from-cache for each object. 'defaultCheck' is an example+ -> Int -- ^ The max number of objects in the cache, if more, the cleanup starts+ -> IO ThreadId -- ^ Identifier of the thread created clearSyncCacheProc= T.clearSyncCacheProc (T.refcache :: T.Cache IDynamic) - -withResource ::(Typeable a, T.IResource a) => a->(Maybe a->a)->IO () ++{- | methods that handle a single datatype. -}++-- | similar to @Data.TCache.withResource@.+-- The fact that this method may return a type different that the source type permits to use ' Key' objects +withResource ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => a-> (Maybe a-> b)-> IO () withResource r f= withResources [r] (\[mr]-> [f mr])- -withResources::(Typeable a, T.IResource a) => [a]->([Maybe a]->[a])->IO () ++-- | similar to @Data.TCache.withResources@.+-- The fact that this method may return a type different that the source type permits to use ' Key' objects +withResources::(Typeable a, Typeable b, T.IResource a, T.IResource b) => [a]-> ([Maybe a]-> [b])-> IO () withResources rs f= withDResources (map toIDyn rs) (\mrs-> f' mrs) where f' = map toIDyn . f . map g g Nothing= Nothing g (Just x)= Just (fromIDyn x)- - -withResourcesID :: (Typeable a, T.IResource a) => [a]->([Maybe a]->[T.Operation a])->IO () -withResourcesID rs f= withDResourcesID (map toIDyn rs) (\mrs-> f' mrs) where- f' = map h . f . map g- g Nothing= Nothing- g (Just x)= Just (fromIDyn x)- h (T.Insert x)= T.Insert $ toIDyn x- h (T.Delete x)= T.Delete $ toIDyn x- - -getResource ::(Typeable a, T.IResource a) => a -> IO (Maybe a) ++-- | similar to @Data.TCache.withSTMResources@.+-- The return in the STM monad permits to participate in larger STM transactions+-- The fact that this method may return a type different that the source type permits to use ' Key' objects +withSTMResources :: forall x.forall a.forall b.(Typeable a, Typeable b, T.IResource a, T.IResource b)+ => [a] -- ^ the list of resources to be retrieved+ -> ([Maybe a]-> T.Resources b x) -- ^ The function that process the resources found and return a Resources structure+ -> STM x -- ^ The return value in the STM monad. +withSTMResources rs f= withDSTMResources (map toIDyn rs) f' where+ f' :: [Maybe IDynamic]-> T.Resources IDynamic x+ f' = h . f . map g++ g (Just x)= Just $ fromIDyn x+ g Nothing = Nothing++ h T.Retry = T.Retry+ h (T.Resources a d r)= T.Resources (map toIDyn a) (map toIDyn d) r++-- | similar to Data.@TCache.getResource@.+-- The fact that this method may return a type different that the source type permits to use ' Key' objects +getResource ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => a -> IO (Maybe b) getResource x= getDResource (toIDyn x) >>= return . g where g Nothing= Nothing g (Just x)= Just (fromIDyn x)- -getResources ::(Typeable a, T.IResource a) => [a] -> IO [Maybe a] ++-- | similar to @Data.TCache.getResources@.+-- The fact that this method may return a type different that the source type permits to use ' Key' objects +getResources ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => [a] -> IO [Maybe b] getResources rs = getDResources (map toIDyn rs) >>= return . map g where g Nothing= Nothing g (Just x)= Just (fromIDyn x) - - +-- | similar to @Data.TCache.deleteResource@ deleteResource ::(Typeable a, T.IResource a) => a -> IO () deleteResource x= deleteDResource (toIDyn x) - ++-- | similar to @Data.TCache.deleteResource@ deleteResources ::(Typeable a, T.IResource a) => [a] -> IO () deleteResources xs= deleteDResources (map toIDyn xs) - - - - - - --
− Data/TCache/Dynamic2.hs
@@ -1,198 +0,0 @@-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -fbang-patterns #-}---- IDynamic: an Extensible, serializable, T.IResource datatype,--- to be used within any container in order to handle, store and retrieve--- heterogeneous datatypes defined in different modules.--module Data.TCache.Dynamic(- T.IResource(..),- Register (- toDyn -- :: x -> IDynamic- ,registerType -- :: x -> IO()- ,fromDyn -- :: IDynamic -> x- ,unsafeFromDyn -- :: IDynamic -> x-))--where-import System.IO.Unsafe-import Control.Concurrent.MVar-import Data.Typeable-import Unsafe.Coerce-import qualified Data.TCache as T-import Debug.Trace----debug a b= trace b a --type IDynamic= forall a. (Typeable a, T.IResource a) => a ----type Deserializer = (String, (String -> IDynamic ))-list :: MVar [fromStringr]--list = unsafePerformIO $ newMVar [] ---instance T.IResource IDynamic where- keyResource ( x)= T.keyResource x- serialize ( x)= show (typeOf x) ++ "\n"++ T.serialize x- deserialize str= case lookup key (unsafePerformIO $ readMVar list) of- Nothing -> error $ "not registered type "++key++" please registerType it"- Just f -> unsafeCoerce $ f tail - - where- (key, tail)= span (/='\n') str---instance Show IDynamic where- show x= T.serialize x- --class Register x where - toDyn :: x -> IDynamic- registerType :: x -> IO()- fromDyn :: IDynamic -> x- unsafeFromDyn :: IDynamic -> x- -- get(toDyn x)== x--instance (T.IResource x,Typeable x) => Register x where- toDyn x= unsafeCoerce x- - registerType x = do- let f= T.deserialize :: (String -> x) - let f1 s= unsafeCoerce (f s) - l <- takeMVar list- putMVar list $ (show $ typeOf x ,f1):l- - fromDyn ( a)= if type2 == type1 then v- else error ("fromDyn: casting "++ "from type "++ T.serialize a ++" to type "++show type2)- where - v= unsafeCoerce a :: x- type1= typeOf a- type2= typeOf v- - unsafeFromDyn ( a)= unsafeCoerce a- - -withDResource :: IDynamic->(Maybe IDynamic->IDynamic)->IO () -withDResource = T.withResource - -withDResources:: [IDynamic]->([Maybe IDynamic]->[IDynamic])->IO () -withDResources = T.withResources -withDResourcesID :: [IDynamic]->([Maybe IDynamic]->[T.Operation IDynamic])->IO () -withDResourcesID = T.withResourcesID - -getDResource :: IDynamic -> IO (Maybe IDynamic) -getDResource = T.getResource - -getDResources :: [IDynamic] -> IO [Maybe IDynamic] -getDResources = T.getResources - --- return error if any resource is not found -justGetDResources rs=do mrs <- getDResources rs - return $ map process $ zip mrs rs - where - process (Nothing, r) = error ("\""++T.keyResource r ++ "\" does not exist") - process (Just r', _) = r' - -justGetDResource r= do [r']<- justGetDResources [r] - return r' - - - -deleteDResource :: IDynamic -> IO () -deleteDResource= T.deleteResource - - -syncCache= T.syncCache (T.refcache :: T.Cache IDynamic) - - - -clearSyncCacheProc= T.clearSyncCacheProc (T.refcache :: T.Cache IDynamic) - --- -withResource ::(Typeable a, T.IResource a) => a->(Maybe a->a)->IO () -withResource r f= withResources [r] (\[mr]-> [f mr])- -withResources::(Typeable a, T.IResource a) => [a]->([Maybe a]->[a])->IO () -withResources rs f= withDResources (map toDyn rs) (\mrs-> f' mrs) where- f' = map toDyn . f . map g- g Nothing= Nothing- g (Just x)= Just (fromDyn x)- - -withResourcesID :: (Typeable a, T.IResource a) => [a]->([Maybe a]->[T.Operation a])->IO () -withResourcesID rs f= withDResourcesID (map toDyn rs) (\mrs-> f' mrs) where- f' = map h . f . map g- g Nothing= Nothing- g (Just x)= Just (fromDyn x)- h (T.Insert x)= T.Insert $ toDyn x- h (T.Delete x)= T.Delete $ toDyn x- - -getResource ::(Typeable a, T.IResource a) => a -> IO (Maybe a) -getResource x= getDResource (toDyn x) >>= return . g where - g Nothing= Nothing- g (Just x)= Just (fromDyn x)- -getResources ::(Typeable a, T.IResource a) => [a] -> IO [Maybe a] -getResources rs = getDResources (map toDyn rs) >>= return . map g where - g Nothing= Nothing- g (Just x)= Just (fromDyn x) - - - -deleteResource ::(Typeable a, T.IResource a) => a -> IO () -deleteResource x= deleteDResource (toDyn x) - - - - - - - - ------------------ tests-----------instance T.IResource Int where- keyResource _= "I"- serialize = show- deserialize = read- - - -instance T.IResource String where- keyResource _= "S"- serialize = show- deserialize = read-----test= do-- registerType (1::Int)- registerType ("hola")- - - withResources [] (\_->[1 ::Int, 1::Int])- withResources [] (\_->[ "hola", "hola"])- - syncCache - - res <- getResources [1::Int, 1::Int]- print res- - res <- getResources ["hola", "hola"]- print res- - res <- getDResources [toDyn "hola", toDyn ( 1::Int)]- print res-
+ Data/TCache/IDynamic.hs view
@@ -0,0 +1,159 @@+{-# OPTIONS -fglasgow-exts -XUndecidableInstances -XBangPatterns #-}++{- |+IDynamic is a indexable and serializable version of Dynamic. (See @Data.Dynamic@). It is used as containers of objects+in the cache so any new datatype can be incrementally stored without recompilation.+IDimamic provices methods for safe casting, besides serializaton, deserialization, registrations and retrieval by lkey.++@data IDynamic= forall a. (Typeable a, IResource a) => IDynamic a deriving Typeable@+-} +module Data.TCache.IDynamic where +import Data.Typeable +import Unsafe.Coerce +import System.IO.Unsafe +import Control.Concurrent.MVar +import Data.Map as M +import Data.TCache.IResource+import Data.RefSerialize +import Data.HashTable(hashString) +import Data.Word+import Numeric (showHex, readHex)++ +data IDynamic= forall a. (Typeable a, IResource a) => IDynamic a deriving Typeable + + +list :: MVar (Map Word (IDynamic -> IO (Maybe IDynamic), String -> IDynamic, ST IDynamic ) ) +list = unsafePerformIO $ newMVar $ empty ++hash x= unsafeCoerce . hashString . show $ typeOf x :: Word +instance IResource IDynamic where + keyResource (IDynamic x)= keyResource x + serialize (IDynamic x)= "Dyn " ++ showHex (hash x) ( " " ++ serialize x) + deserialize str2=+ let+ str= drop 4 str2+ [(t :: Word, str1)]= readHex str++ in+ case M.lookup t (unsafePerformIO $ readMVar list) of + Nothing -> error $ "not registered type " ++ str1 ++ " please registerType it" + Just (_, f, _)-> f $ tail str1 ++ tshowp (IDynamic x)= do+ str <- tshowp x+ return $ "Dyn " ++ showHex (hash x) ( " "++ str)++ treadp = do+ symbol "Dyn"+ t <- readHexp++ case M.lookup t (unsafePerformIO $ readMVar list) of + Nothing -> fail $ "not registered type please registerType it" + Just (_,_, f)-> f+ <?> "IDynamic"+ + defPath (IDynamic x)= defPath x + + writeResource (IDynamic x)= writeResource x + + readResource d@(IDynamic x) + | typeOfx== typeOf Key= do+ mx <- readResource x --`debug` ("retrieving key "++ show (typeOf x)) + case mx of + Nothing -> return $ Nothing + Just x -> return $ Just $ toIDyn x + | otherwise= + case M.lookup type1 (unsafePerformIO $ readMVar list) of + Nothing -> error $ "not registered type " ++ show (typeOf x) ++ " please registerType it" + Just (f ,_,_)-> f d + where+ typeOfx= typeOf x + type1= unsafeCoerce $ hashString $ show typeOfx :: Word + + +instance Show IDynamic where + show (IDynamic x)= "(IDynamic \""++show (typeOf x) ++"\" "++ serialize x++")" + + +-- | DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it ++class DynamicInterface x where+ toIDyn :: x -> IDynamic -- ^ encapsulates data in a dynamic object + registerType :: IO x -- ^ registers the deserialize, readp and readResource methods for this data type + fromIDyn :: IDynamic -> x -- ^ extract the data from the dynamic object. trows a user error when the cast fails + unsafeFromIDyn :: IDynamic -> x -- ^ unsafe version. + safeFromIDyn :: IDynamic -> Maybe x -- ^ safe extraction with Maybe + +instance (IResource x,Typeable x) => DynamicInterface x where++ + toIDyn x= IDynamic x + + registerType = do + + let x= unsafeCoerce 1 :: x ++ let deserializex str= toIDyn (deserialize str :: x)+ let treadpx = do+ t<- treadp :: ST x+ return $ toIDyn t + let readResourcex (IDynamic s)= do + mr <- readResource (unsafeCoerce s :: x) :: IO (Maybe x) + case mr of + Nothing -> return Nothing + Just s' -> return $ Just $ IDynamic s' + l <- takeMVar list++ let key= hash x ++ case M.lookup key l of + Just _ -> do + putMVar list l + return x + _ -> do + putMVar list $ insert key (readResourcex, deserializex, treadpx ) l + return x ++ + + fromIDyn d@(IDynamic a)= if type2 == type1 then v + else error ("fromIDyn: casting "++ show type1 ++" to type "++show type2 ++" for data "++ serialize a) + where + v= unsafeCoerce a :: x + type1= typeOf a + type2= typeOf v + + unsafeFromIDyn (IDynamic a)= unsafeCoerce a ++ safeFromIDyn (IDynamic a)= let v= unsafeCoerce a :: x in if typeOf a == typeOf v then Just v else Nothing+ +{- | Key datatype can be used to read any object trough the Dynamic interface.+ + @ data Key = Key 'TypeRep' String deriving Typeable @++ Example+ + @ mst <- 'getDResource' $ 'Key' type 'keyofDesiredObject'+ case mst of+ Nothing -> error $ \"not found \"++ key+ Just (idyn) -> fromIDyn idyn :: DesiredDatatype}@ +-} + +data Key = Key TypeRep String deriving Typeable + + +instance IResource Key where + keyResource (Key _ k)=k + serialize _= error "Key is not serializable" + deserialize _= error "Key is not serializable" + writeResource _= error "Please don't create Key objects" + readResource key@(Key t _)= + case M.lookup type1 (unsafePerformIO $ readMVar list) of + Nothing -> error $ "not registered type "++show t++" please registerType it" + Just (f,_,_) -> do+ d <- f . toIDyn $ key + return $ dynMaybe d + where + dynMaybe (Just dyn)= return $ fromIDyn dyn + type1= hash t
+ Data/TCache/IResource.hs view
@@ -0,0 +1,190 @@+module Data.TCache.IResource where + +import System.Directory +import Control.Exception as Exception +import System.IO.Error +import Data.List(elemIndices) +import System.IO +import Control.Monad(when,replicateM)+import qualified Data.RefSerialize as RS+ +--import Debug.Trace++--debug a b= trace b a + +{- | Interface that must be defined for every object being cached. + 'readResource' and 'writeResource' are implemented by default as read-write to files with its key as filename + 'serialize' and 'deserialize' are specified just to allow these defaults. If you define your own persistence, then+ @serialize@ and @deserialize@ are not needed. The package 'Workflow' need them anyway. + +minimal definition: keyResource, serialize, deserialize++While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and+tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined+by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be+serialized as part of larger structures that embody them. This is necessary for the Workdlow package.+ +The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example:+ +@data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s@ + +the data being accesed must have the fields used by keyResource filled. For example++ @ readResource Person {name="John", surname= "Adams"}@ + +leaving the rest of the fields undefined + +-} ++-- | IResource has defaults definitions for all the methods except keyResource+-- Either one or other serializer must be defiened for default witeResource, readResource and delResource +class IResource a where ++ keyResource :: a -> String -- ^ must be defined++ serialize :: a -> String -- ^ must be defined by the user+ serialize x= RS.runW $ tshowp x+ + deserialize :: String -> a -- ^ must be defined by the user+ deserialize str = RS.runR treadp str + ++ tshowp :: a -> RS.ST String -- ^ serializer in the 'RefSerialize' monad. Either one or other serializer must be defined to use default persistence+ tshowp x= do+ let str= serialize x+ let l= length str+ return $ show l ++ " " ++ str++ treadp :: RS.ST a -- ^ deserialize in the RefSerilzlize monad.+ treadp = do+ l <- RS.readp++ str <- replicateM l RS.anyChar+ return $ deserialize str+ + defPath :: a-> String -- ^ additional extension for default file paths or key prefixes + defPath _ = "" + + -- get object content from the file + -- (NOTE: reads and writes can't collide, so they-- Not really needed since no write is done while read + -- must be strict, not lazy ) + readResource :: a-> IO (Maybe a) + readResource x=handleJust Exception.ioErrors handle $ do + s <- readFileStrict filename :: IO String + return $ Just $ deserialize s -- `debug` ("read "++ filename) + where + filename= defPath x++ keyResource x + --handle :: IResource a => IOError -> IO (Maybe a) + handle e + |isAlreadyInUseError e = readResource x -- maybe is being written. try again. + + | isDoesNotExistError e = return Nothing + | isPermissionError e = error $ "readResource: no permissions for opening file: "++filename + | otherwise= error $ "readResource: " ++ show e + + writeResource:: a-> IO() + writeResource x= handleJust Exception.ioErrors (handle x) $ writeFile filename (serialize x) -- `debug` ("write "++filename) + where + filename= defPath x ++ keyResource x + --handle :: a -> IOError -> IO () + handle x e + | isDoesNotExistError e=do + createDirectoryIfMissing True $ take (1+(last $ elemIndices '/' filename)) filename --maybe the path does not exist + writeResource x +-- | isAlreadyInUseError e= writeResource x -- maybe is being read. try again + -- Not really needed since no write is done while read ++ | otherwise =do+ hPutStrLn stderr $ "writeResource: " ++ show e ++ " in file: " ++ filename ++ " retrying" + writeResource x+ {-+ | isAlreadyExistsError e =+ do+ hPutStrLn stderr $ "writeResource: already exist file: " ++ filename ++ " retrying"+ writeResource x++++ | isAlreadyInUseError e =+ do+ hPutStrLn stderr $ "writeResource: already in use: " ++ filename ++ " retrying"+ writeResource x+ | isFullError e =+ do+ hPutStrLn stderr $ "writeResource: file full: " ++ filename ++ " retrying"+ writeResource x+ | isEOFError e =+ do+ hPutStrLn stderr $ "writeResource: EOF in file: " ++ filename ++ " retrying"+ writeResource x+ | isIllegalOperation e=+ do+ hPutStrLn stderr $ "writeResource: illegal Operation in file: " ++ filename ++ " retrying"+ writeResource x+ | isPermissionError e =+ do+ hPutStrLn stderr $ "writeResource:permission error in file: " ++ filename ++ " retrying"+ writeResource x+ | isUserError e =+ do+ hPutStrLn stderr $ "writeResource:user error in file: " ++ filename ++ " retrying"+ writeResource x+++ | otherwise =do+ hPutStrLn stderr $ "writeResource: error " ++ show e ++ " in file: " ++ filename + writeResource x +-} + + delResource:: a-> IO() + delResource x= handleJust Exception.ioErrors (handle filename) $ removeFile filename --`debug` ("delete "++filename)+ + where+ filename= defPath x ++ keyResource x + handle :: String -> IOError -> IO () + handle file e + | isDoesNotExistError e= return ()+ | isAlreadyInUseError e= delResource x+ | isPermissionError e= delResource x+ + | otherwise = error ("delResource: " ++ show e ++ "for the file: "++ filename) + + + +type AccessTime = Integer +type ModifTime = Integer + + +infinite=10000000000 + +-- | Resources returned by 'withSTMResources'' +data Resources a b+ = Retry -- ^ forces a retry+ | Resources + { toAdd :: [a] -- ^ resources to be inserted back in the cache+ , toDelete :: [a] -- ^ resources to be deleted from the cache and from permanent storage + , toReturn :: b -- ^ result to be returned + }+ ++-- | @resources= Resources [] [] ()@+resources :: Resources a () +resources= Resources [] [] () + + + +-- Strict file read, needed for the default file persistence +readFileStrict f = openFile f ReadMode >>= \ h -> readIt h `finally` hClose h+ where+ readIt h= do + s <- hFileSize h + let n= fromIntegral s + str <- replicateM n (hGetChar h) + return str + + +
+ Data/TCache/TMVar.hs view
@@ -0,0 +1,378 @@+{-# OPTIONS -fglasgow-exts -XUndecidableInstances #-} + + +{- | A version of @Data.TCache@ using @TMVar@s instead of @TVars@s. See @Control.Concurrent.TMVar@+-} + +module Data.TCache.TMVar ( + + IResource(..) -- class interface to be implemented for the object by the user+ +,Resources(..) -- data definition used to communicate object Inserts and Deletes to the cache +,resources -- empty resources + +,getTMVars -- :: (IResource a)=> [a] -- the list of resources to be retrieved+ -- -> IO [Maybe (TMVar a)] -- The Transactional variables+ +,getTMVarsIO -- :: (IResource a)=> [a] -> IO [TMVar a] + +,withSTMResources -- :: (IResource a)=> [a] -- list of resources to retrieve + -- -> ([Maybe a]-> Res a x) -- the function to apply that contains a Res structure + -- -> STM x -- return value within the STM monad ++ +,withResources -- :: (IResource a)=> [a] --list of resources to be retrieve + -- -> ([Maybe a]-> [a]) ----function that get the retrieved resources + -- -> IO () --and return a list of objects to be inserted/modified + +,withResource -- :: (IResource a)=> a --same as withResources , but for one only object + -- -> ([Maybe a]-> a) -- + -- -> IO () -- + +,getResources -- :: (IResource a)=>[a] --resources [a] are read from cache and returned + -- -> IO [Maybe a] + +,getResource -- :: :: (IResource a)=>a --to retrieve one object instead of a list + -- -> IO [Maybe a] + +,deleteResources -- :: (IResource a)=>[a]-> IO() -- delete the list of resources from cache and from persistent storage +,deleteResource -- :: (IResource a)=>a-> IO() -- delete the resource from cache and from persistent storage + + +--cache handling +,Cache -- :: IORef (Ht a,Int, Integer) --The cache definition + +,setCache -- :: Cache a -> IO() -- set the cache. this is useful for hot loaded modules that will use an existing cache + +,newCache -- :: (Ht a, Integer) --newCache creates a new cache + +,refcache -- :: Cache a --the reference to the cache (see data definition below) + +,syncCache -- :: (IResource a) =>Cache a -> IO() --force the atomic write of all the cache objects into permanent storage + --useful for termination + +--start the thread that clean and writes on the persistent storage trough syncCache +,clearSyncCacheProc -- :: (IResource a) =>Cache a --The cache reference + -- -> Int --number of seconds betwen checks + -- -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object + --(when True, the object is removed from cache) + -- -> Int --The max number of objects in the cache, if more, the cleanup start + -- -> >IO ThreadId --Identifier of the thread created + +-- the default check procedure +,defaultCheck -- :: Integer -- current time in seconds + -- -> Integer --last access time for a given object + -- -> Integer --last cache syncronization (with the persisten storage) + -- -> Bool --return true for all the elems not accesed since + --half the time between now and the last sync + +-- auxiliary +,readFileStrict -- :: String -> IO String -- Strict file read, needed for the default file persistence + + +) +where + +import GHC.Conc +import Control.Concurrent.STM.TMVar+import Control.Monad(when) +import Data.HashTable as H +import Data.IORef +import System.IO.Unsafe+import System.Time +import Data.Maybe(catMaybes,mapMaybe) +import Debug.Trace +import Data.TCache.IResource +import Control.Exception(handle,assert) +import Data.List (nubBy,deleteFirstsBy ) + +debug a b= trace b a + +type Block a= (TMVar a,AccessTime,ModifTime) +type Ht a= HashTable String (Block a) +-- contains the hastable, number of items, last sync time +type Cache a= IORef (Ht a, Integer) +data CheckBlockFlags= AddToHash | NoAddToHash | MaxTime + +-- |set the cache. this is useful for hot loaded modules that will update an existing cache +setCache :: (Ht a, Integer) -> IO() +setCache ch= writeIORef refcache ch + +-- the cache holder. stablished by default +refcache :: Cache a +refcache =unsafePerformIO $do + c <- newCache + newIORef c + +-- | newCache creates a new cache +newCache :: IO (Ht a, Integer) +newCache =do + c <- H.new (==) hashString + return (c,0) + + +-- | getTMVars return the TMVar that wraps the resources for which the keys are given . +-- | it return Nothing if a TMVar with this object has not been allocated +-- These TMVars can be used in explicit user constructed atomic blocks +-- Additionally, the TMVars remain in the cache and can be accessed and updated by the rest +-- of the TCache methods. +-- the content of the TMVars are written every time the cache is syncronized with the storage until releaseTMVars is called + +-- :: (IResource a)=> [a] -- the list of resources to be retrieved +-- -> IO [Maybe (TMVar a)] -- The Transactional variables + +getTMVars :: (IResource a)=> [a] -> STM [Maybe (TMVar a)]+getTMVars rs= do+ (cache,_) <- unsafeIOToSTM $ readIORef refcache + takeBlocks rs cache MaxTime + +-- | releaseTMVars permits the TMVars captured by getTMVars to be released. so they can be discarded when not used +-- Use this when you no longer need to use them directly in atomic blocks. +releaseTMVars :: (IResource a)=> [a]-> STM () +releaseTMVars rs=do + (cache,_) <- unsafeIOToSTM $ readIORef refcache + releaseBlocks rs cache + +-- | getTMVarsIO does not search for a TMVar in the cache like getTMVars. Instead of this getTMVarsIO creates a list of +-- TMVars with the content given in the list of resourcees and add these TMVars to the cache and return them. +-- the content of the TMVars are written every time the cache is syncronized with the storage until releaseTMVars is called +getTMVarsIO :: (IResource a)=> [a] -> IO [TMVar a] +getTMVarsIO rs= do + tvs<- mapM newTMVarIO rs + (cache,_) <- readIORef refcache + mapM_ (\(tv,r)-> H.update cache (keyResource r) (tv, infinite, infinite)) $ zip tvs rs + return tvs + + + +-- | this is the main function for the *Resources primitivas, all the rest derive from it. the Res structure processed by the +-- with*Resources primitives are more efficient for cached TMVars because the internal loop is never retried, since all the necessary +-- resources at the beginning so no costly retries are necessary. The advantage increases with the complexity of the process +-- function passed to withSTMResources is interpreted as such: +-- -toUpdate secton is used to update the retrieved resources in the same order. +-- if the resource don´t exist, it is created. Nothing means do nothing as usual. extra resources are not considered, +-- it uses the rules of zip. +-- -toAdd: additional resources not read in the first parameter of withSTMResources are created/updated with toAdd +-- -toDelete: obvious +-- -toReturn: will be returned by the call + + +withSTMResources :: (IResource a)=> [a] -- ^ the list of resources to be retrieved + -> ([Maybe a]-> Resources a x) -- ^ The function that process the resources found and return a Resources structure + -> STM x -- ^ The return value in the STM monad. +withSTMResources rs f= do + (cache,_) <- unsafeIOToSTM $ readIORef refcache + mtrs <- takeBlocks rs cache NoAddToHash + + mrs <- mapM mreadTMVar mtrs + case f mrs of+ Retry -> retry+ Resources as ds r -> do + unsafeIOToSTM $ do+ delListFromHash cache $ map keyResource ds + mapM delResource ds + releaseBlocks as cache + return r + + where + + + + mreadTMVar (Just tvar)= do r <- takeTMVar tvar + return $ Just r + mreadTMVar Nothing = return Nothing + + +-- | update of a single object in the cache +-- :: (IResource a)=> a same as withResources , but for one only object +-- -> ([Maybe a]-> a) +-- -> IO () +withResource:: (IResource a)=> a-> (Maybe a-> a)-> IO () +withResource r f= withResources [r] (\[mr]-> [f mr]) +++-- | to atomically add/modify many objects in the cache +-- :: (IResource a)=> [a] list of resources to be retrieve +-- -> ([Maybe a]-> [a]) function that process the retrieved resources +-- -> IO () and return a list of objects to be inserted/modified ++withResources:: (IResource a)=> [a]-> ([Maybe a]-> [a])-> IO () +withResources rs f= atomically $ withSTMResources rs f1 >> return() where + f1 mrs= let as= f mrs in Resources as [] ()+ +-- | to read a resource from the cache +getResource r= do{mr<- getResources [r];return $! head mr} + +---to read a list of resources from the cache if they exist +-- :: (IResource a)=>[a] resources [a] are read from cache and returned +-- -> IO [Maybe a] the result + +getResources:: (IResource a)=>[a]-> IO [Maybe a] +getResources rs= atomically $ withSTMResources rs f1 where + f1 mrs= Resources [] [] mrs + + +-- | delete the resource from cache and from persistent storage + +deleteResource r= deleteResources [r] + +-- | delete the list of resources from cache and from persistent storage + +deleteResources rs= atomically $ withSTMResources rs f1 where + f1 mrs = Resources [] (catMaybes mrs) () + + ++takeBlocks :: (IResource a)=> [a] -> Ht a -> CheckBlockFlags -> STM [Maybe (TMVar a)]+takeBlocks rs cache addToHash= mapM (checkBlock cache addToHash) rs + where+ checkBlock :: IResource a => Ht a -> CheckBlockFlags -> a-> STM(Maybe (TMVar a)) + checkBlock cache flags r =do + c <- unsafeIOToSTM $ H.lookup cache keyr + case c of + Nothing -> do + mr <- unsafeIOToSTM $ readResource r -- `debug` ("read "++keyr++ " hash= "++ (show $ H.hashString keyr)) + case mr of + Nothing -> return Nothing + Just r2 -> do + tvr <- newTMVar r2 + case flags of + NoAddToHash -> return $ Just tvr + AddToHash -> do + ti <- unsafeIOToSTM timeInteger + unsafeIOToSTM $ H.update cache keyr (tvr, ti, 0) -- accesed, not modified + return $ Just tvr + + MaxTime -> do + unsafeIOToSTM $ H.update cache keyr (tvr, infinite, infinite) -- accesed, not modified + return $ Just tvr++ + + Just(tvr,_,_) -> return $ Just tvr + + where keyr= keyResource r ++ +releaseBlocks :: (IResource a)=> [a] -> Ht a -> STM ()+releaseBlocks rs cache = mapM_ checkBlock rs + + where + checkBlock r =do + c <- unsafeIOToSTM $ H.lookup cache keyr + case c of + Nothing -> do tvr <- newTMVar r + ti <- unsafeIOToSTM timeInteger + unsafeIOToSTM $ H.update cache keyr (tvr, ti, ti ) -- accesed and modified XXX + + + Just(tvr,_,tm) -> do + ti <- unsafeIOToSTM timeInteger + let t= max ti tm + try<- tryPutTMVar tvr r --putTMVar tvr r + case try of + False -> do swapTMVar tvr r; return () + True -> return () + unsafeIOToSTM $ H.update cache keyr (tvr ,t,t) + + + + where keyr= keyResource r + + +timeInteger= do TOD t _ <- getClockTime + return t + + + +delListFromHash hash l= do{mapM (delete hash) l; return()} + +updateListToHash hash kv= do{mapM (update1 hash) kv; return()}where + update1 h (k,v)= update h k v + +-----------------------clear, sync cache------------- +-- | start the thread that clean and writes on the persistent storage. +-- Otherwise, clearSyncCache must be invoked explicitly or no persistence will exist +-- :: (IResource a) =>Cache a --The cache reference +-- -> Int --number of seconds betwen checks +-- -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object + --(when this function return True, the object is removed from cache) +-- -> Int --The max number of objects in the cache, if more, the cleanup start +-- -> >IO ThreadId --Identifier of the thread created + +clearSyncCacheProc :: (IResource a)=> Cache a-> Int-> (Integer -> Integer-> Integer-> Bool)-> Int-> IO ThreadId +clearSyncCacheProc refcache time check sizeObjects= + forkIO clear + + where+ clear = do + threadDelay $ (fromIntegral$ time * 1000000) + clearSyncCache refcache time check sizeObjects + clear + +-- | force the atomic write of all the cached objects into permanent storage +-- useful for termination +syncCache refcache = do + (cache,t1) <- readIORef refcache + list <- toList cache + t2<- timeInteger + atomically $ save list t1 + writeIORef refcache (cache, t2) + + --print $ "write to persistent storage finised: "++ show (length list)++ " objects" + +-- | Saves the unsaved elems of the cache +-- delete some elems of the cache when the number of elems > sizeObjects +-- The deletion depends on the check criteria. defaultCheck is the one implemented +clearSyncCache ::(IResource a) => Cache a-> Int -> (Integer -> Integer-> Integer-> Bool)-> Int -> IO () +clearSyncCache refcache time check sizeObjects=do + (cache,lastSync) <- readIORef refcache + handle (\e-> do{print e;return ()})$ do + elems <- toList cache + let size=length elems + atomically $ save elems lastSync + t<- timeInteger + when (size > sizeObjects) (filtercache t cache lastSync elems) + writeIORef refcache (cache, t) + + where + -- delete elems from the cache according with the check criteria + filtercache t cache lastSync elems= mapM_ filter elems + where + check1 (_,lastAccess,_)=check t lastAccess lastSync + + filter ::(String,Block a)-> IO Int + filter (k,e)= if check1 e then do{H.delete cache k;return 1} else return 0 + +-- | To drop from the cache all the elems not accesed since half the time between now and the last sync +-- the default check procedure +-- :: Integer -- current time in seconds +-- -> Integer --last access time for a given object +-- -> Integer --last cache syncronization (with the persisten storage) +-- -> Bool --return true for all the elems not accesed since + --half the time between now and the last sync + +defaultCheck:: Integer -> Integer-> Integer-> Bool +defaultCheck now lastAccess lastSync + | lastAccess > halftime = False + | otherwise = True + + where + halftime= now- (now-lastSync) `div` 2 + + + +save:: (IResource a) => [(String, Block a)]-> Integer-> STM () +save list lastSave= mapM_ save1 list --`debug` ("saving "++ (show $ length list)) + where+ save1 :: IResource a =>(String, Block a) -> STM() + save1(_, (tvr,_,modTime))= do + if modTime >= lastSave --`debug` ("modTime="++show modTime++"lastSave="++show lastSave) + then do + r<- readTMVar tvr + unsafeIOToSTM $! writeResource r --`debug` ("saved " ++ keyResource r) + else return() + + + +
+ Data/TCache/TMVar/Dynamic.hs view
@@ -0,0 +1,183 @@+{-# OPTIONS -fglasgow-exts #-}++{- | Data.TCache.TMVar.Dynamic:+A dynamic interface for TCache using TMVars++Dynamic present essentially the same methods than Data.TCache. The added functionality is the management+of IDynamic types. Any datatype that is instance of IResource and Typeable can be handled mixed with any other+datatype. TCache.Dynamic is essentially a TCache working with a single datatype: IDynamic that is indexable and+serializable. You don´t need to do anything special except to define the IResource and typeable instances for+your particular datatype. Also, before use, your datatype must be registered (with registerType, see example in the package).++there are basically two types of methods:++ **Resource(s) : manage one type of data, Are the same than Data.TCache. The marsalling to and from IDynamic is managed internally++ **DResource(s): handle the IDynamic type. you must wrap your datatype (with toIDyn) and unwap it (with fromIDyn)++The first set allows different modules to handle their particular kind of data without regard that it is being handled in the same cache with other datatypes.++The second set allows to handle, transact etc with many datatypes at the same time.++There is also a useful Key object whose purpose is to retrieve any objecto fo any datatype by its sting key++Also the parameter refcache has been dropped from the methods that used it (the syncronization methods)++-}++module Data.TCache.TMVar.Dynamic(+ T.IResource(..) -- from TCache+ ,T.Resources(..)+ ,T.resources+ ,T.setCache+ ,T.refcache+ ,T.defaultCheck,T.readFileStrict+ ,I.IDynamic(..) -- serializable/indexable existential datatype+ ,T.Cache+++ ,DynamicInterface (+ toIDyn -- :: x -> IDynamic+ ,registerType -- :: x+ ,fromIDyn -- :: IDynamic -> x+ ,unsafeFromIDyn -- :: IDynamic -> x++ )+ --,ofType+ ,I.Key(..) {- Key datatype can be used to read any object trough the Dynamic interface++ let key= <key of the object >+ mst <- getDResource $ Key (ofType :: Type) key+ case mst of+ Nothing -> error $ "getResource: not found "++ key+ Just (idyn) -> do+ let st = fromIDyn idyn :: <desired datatype>+ ....+ -}++-- same access interface , this time for Dynamic type. See Data.TCache for their equivalent definitions+,getTMVars,getTMVarsIO,withDResource, withDResources, withDSTMResources, getDResource, getDResources, deleteDResource, deleteDResources+++-- syncache has no parameters now (see Data.TCache.syncCache) +,syncCache++-- Same than Data.TCache but without Cache parameter +,clearSyncCacheProc + +-- the same interface for any datatype: +, withResource, withResources, withSTMResources, getResource, getResources, deleteResource, deleteResources +++)++where++import System.IO.Unsafe+import Data.Typeable+import qualified Data.TCache.TMVar as T+import Data.TCache.IDynamic as I+import Debug.Trace+import Control.Concurrent.STM(atomically,STM)+import Control.Concurrent.STM.TMVar+import Control.Concurrent(forkIO)+import Control.Exception(finally)+++debug a b= trace b a+++ +withDResource :: IDynamic->(Maybe IDynamic->IDynamic)->IO () +withDResource = T.withResource+ +withDResources:: [IDynamic]->([Maybe IDynamic]->[IDynamic])->IO () +withDResources = T.withResources++ +withDSTMResources :: [IDynamic]->([Maybe IDynamic]->T.Resources IDynamic x)->STM x +withDSTMResources = T.withSTMResources+ +getDResource :: IDynamic -> IO (Maybe IDynamic) +getDResource = T.getResource + +getDResources :: [IDynamic] -> IO [Maybe IDynamic] +getDResources = T.getResources ++getTMVars :: [IDynamic] -> STM [Maybe (TMVar IDynamic)]+getTMVars= T.getTMVars++getTMVarsIO :: [IDynamic] -> IO [TMVar IDynamic]+getTMVarsIO= T.getTMVarsIO+++ +-- | return error if any resource is not found +justGetDResources rs=do mrs <- getDResources rs + return $ map process $ zip mrs rs + where + process (Nothing, r) = error ("\""++T.keyResource r ++ "\" does not exist") + process (Just r', _) = r' + +justGetDResource r= do [r']<- justGetDResources [r] + return r' + + + +deleteDResource :: IDynamic -> IO () +deleteDResource= T.deleteResource ++deleteDResources :: [IDynamic] -> IO () +deleteDResources= T.deleteResources + +syncCache= T.syncCache (T.refcache :: T.Cache IDynamic) + + + +clearSyncCacheProc= T.clearSyncCacheProc (T.refcache :: T.Cache IDynamic) + +withResource ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => a->(Maybe a->b)->IO () +withResource r f= withResources [r] (\[mr]-> [f mr])+ +withResources::(Typeable a, Typeable b, T.IResource a, T.IResource b) => [a]->([Maybe a]->[b])->IO () +withResources rs f= withDResources (map toIDyn rs) (\mrs-> f' mrs) where+ f' = map toIDyn . f . map g+ g Nothing= Nothing+ g (Just x)= Just (fromIDyn x)++ +withSTMResources :: forall x.forall a.forall b.(Typeable a, Typeable b, T.IResource a, T.IResource b) => [a] -- ^ the list of resources to be retrieved+ ->([Maybe a]-> T.Resources b x) -- ^ The function that process the resources found and return a Resources structure+ -> STM x -- ^ The return value in the STM monad. +withSTMResources rs f= withDSTMResources (map toIDyn rs) f' where+ f' :: [Maybe IDynamic]-> T.Resources IDynamic x+ f' = h . f . map g++ g (Just x)= Just $ fromIDyn x+ g Nothing = Nothing+++ maybeDyn ( Just x) = Just $ toIDyn x+ maybeDyn Nothing = Nothing++ h (T.Resources a d r)= T.Resources (map toIDyn a) (map toIDyn d) r++ +getResource ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => a -> IO (Maybe b) +getResource x= getDResource (toIDyn x) >>= return . g where + g Nothing= Nothing+ g (Just x)= Just (fromIDyn x)+ +getResources ::(Typeable a, Typeable b, T.IResource a, T.IResource b) => [a] -> IO [Maybe b] +getResources rs = getDResources (map toIDyn rs) >>= return . map g where + g Nothing= Nothing+ g (Just x)= Just (fromIDyn x) + + + +deleteResource ::(Typeable a, T.IResource a) => a -> IO () +deleteResource x= deleteDResource (toIDyn x) + +deleteResources ::(Typeable a, T.IResource a) => [a] -> IO () +deleteResources xs= deleteDResources (map toIDyn xs) +
− DynamicSample.hs
@@ -1,56 +0,0 @@-{-# OPTIONS -XTypeSynonymInstances #-} --- XTypeSynonymInstances added only to permit IResource instances for Strings -module Main where -import Data.TCache.Dynamic - -{------------- tests--------- -example of IDynamic usage. - --} - ---very simple data: ---two objects with two different datatypes: Int and String - -instance IResource Int where - keyResource _= "I" - serialize = show - deserialize = read - defPath _= "data/" - - - -instance IResource String where - keyResource _= "S" - serialize = show - deserialize = read - defPath _= "data/" - - - - -main= do - - registerType :: IO Int -- register both datatypes (Int, and String) - registerType :: IO String - - let x= 1:: Int - withDResources [] (\_->[toIDyn x, toIDyn "hola"]) --resource creation for the example - - syncCache --syncCache now has no parameters (refcache is not used) - - res <- getResources [1::Int, 1::Int] --getResources works as allways - print res - - res <- getResources ["hola", "hola"] --with multiple datatypes this time - print res - - res <- getDResources [toIDyn "hola", toIDyn ( 1::Int)] -- DResource calls can manage many datatypes simultaneously - print res - - mres <- getDResource $ IDynamic $ Key "S" --Key permits to retrieve any object of any datatype - case mres of - Nothing -> error "not found" - Just res -> do - print (fromIDyn res :: String) -- get the String content - - print (fromIDyn res :: Int) -- error reported: casting a String object to Int
+ IDE.session view
@@ -0,0 +1,15 @@+Time of storage: + "Wed Sep 23 23:57:43 Hora de verano romance 2009" +Layout: VerticalP (HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Just TopP, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Just TopP, currentPage = -1, detachedId = Nothing, detachedSize = Nothing}) 420) (HorizontalP (TerminalP {paneGroups = fromList [("Debug",HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Just RightP, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 109)], paneTabs = Just BottomP, currentPage = 1, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Just BottomP, currentPage = 1, detachedId = Nothing, detachedSize = Nothing}) 234) 680 +Population: [(Just (BreakpointsSt BreakpointsState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (ErrorsSt ErrorsState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (BufferSt (BufferState "C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache\\IResource.hs" 2503)),[SplitP LeftP,SplitP TopP]),(Just (InfoSt (InfoState (Descr {descrName' = "showHex", typeInfo' = "showHex :: forall a. Integral a => a -> ShowS\n", descrModu' = PM {pack = PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}, modu = ModuleName ["Numeric"]}, mbLocation' = Nothing, mbComment' = Nothing, details' = VariableDescr}))),[SplitP RightP,SplitP BottomP]),(Just (LogSt LogState),[SplitP RightP,SplitP BottomP]),(Just (ModulesSt (ModulesState 195 (System,True) (Nothing,Nothing) (ExpanderState {localExp = ([],[]), localExpNoBlack = ([[5,16],[5,13],[5,1],[5],[4,0,1],[4,0,0],[4,0],[4],[1,0],[1],[0]],[]), packageExp = ([[4],[0]],[]), packageExpNoBlack = ([],[]), systemExp = ([],[]), systemExpNoBlack = ([],[])}))),[SplitP RightP,SplitP BottomP]),(Just (ReferencesSt (ReferencesState {refTo = Just (Descr {descrName' = "multisetEditor", typeInfo' = "multisetEditor :: forall alpha.\n (Show alpha, Default alpha, Eq alpha) =>\n ColumnDescr alpha\n -> (Editor alpha, Parameters)\n -> Maybe ([alpha] -> [alpha])\n -> Maybe (alpha -> alpha -> Bool)\n -> Editor [alpha]\n", descrModu' = PM {pack = PackageIdentifier {pkgName = PackageName "leksah", pkgVersion = Version {versionBranch = [0,5,0], versionTags = []}}, modu = ModuleName ["Graphics","UI","Editor","Composite"]}, mbLocation' = Just (Location {locationSLine = 499, locationSCol = 0, locationELine = 616, locationECol = 25}), mbComment' = Just "An editor with a subeditor, of which a list of items can be selected\n\n", details' = VariableDescr}), refScope = Package})),[SplitP RightP,SplitP BottomP]),(Just (SearchSt (SearchState {searchString = "number", searchScope = System, searchMode = Prefix {caseSense = True}})),[SplitP RightP,SplitP TopP]),(Just (TraceSt TraceState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (VariablesSt VariablesState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (BufferSt (BufferStateTrans "_Eval.hs" ":l demos\\fact.hs\n\nrunW $ tshowp $ tFact 1 1\nmain\n\nrunR treadp \"9 Fact 1 1\" :: Fact" 51)),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP TopP])] +Window size: (1024,540) +Active package: + Just "C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\TCache.cabal" +Active pane: Just "IResource.hs" +Toolbar visible: + True +FindbarState: (True,FindState {entryStr = "I.", entryHist = ["I.","ll the rest derive from it","clearSyncCacheProc","DynamicIn","takeBlocks","size","getTVars ","cate","unsa","logWFF","logWFD","orElse"], replaceStr = "PMonadTrans", replaceHist = [], caseSensitive = False, entireWord = False, wrapAround = True, regex = False, lineNr = 1}) +Recently opened files: + ["C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache\\IResource.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache\\Dynamic.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache\\IDynamic.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\RefSerialize.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\demo.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\tutorial.txt","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.5.5\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache\\TMVar.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\Data\\TCache.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.4\\TCache.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\Data\\Serialize.hs","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\Data\\Parser.hs"] +Recently opened packages: + ["C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.5.5\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.5\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.4\\RefSerialize.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.3\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\TCache-0.6.3\\TCache.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.4.6\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\RefSerialize-0.2.3\\RefSerialize.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\tests\\All\\test.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.4.5\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Workflow-0.4\\Workflow.cabal","C:\\Documents and Settings\\Alberto Gomez Corona\\Mis documentos\\haskell\\devel\\Cluster-0.3.3 distributed TVar nosync\\Cluster.cabal"]
− Sample.hs
@@ -1,101 +0,0 @@- module Main where----------------------------------------------------- A example of Transactional cache usage (TCache.hs)--- (Something like the Java Hibernate)--- Author: Alberto Gómez Corona Nov 2006--- Language: Haskell--- Terms of use: you can do whatever you want--- with this code as long as you keep this notice---------------------------------------------------import Data.TCache--import Control.Concurrent-import Debug.Trace--debug a b= trace b a----1 and 4: The data elements to be used in the example: A user will repeatedly buy Items.--data Data= User{uname::String, uid::String, spent:: Int} |- Item{iname::String, iid::String, price::Int, stock::Int}- - deriving (Read, Show)----3 The mappings between the cache and the phisical storage are defined by the interface IResource---- to extract the resource unique key,---- to read the resource from the physical storage,---- to store it and---- to delete the resource from the physical storage.-- --instance IResource Data where- keyResource User{uid=id}= id- keyResource Item{iid=id}= id - serialize x= show x- deserialize x= read x- defPath _ = "data/" -- directory where the data is stored.- - -- other definable methods: readResource, writeResource delResource. here the default persistence in files are used- --- buy is the operation to be performed in the example----4 withResources gets a partial definition of each resource necessary for extracting the key, ---fill all the rest of the data structures (if found ) and return a list of Maybe Data. ---BuyIt is part of the domain problem. it receive this list and generates a new list of ---data objects that are updated in the cache. buyIt is executed atomically.---user `buy` item=- withResources[user,item] buyIt-- where-- buyIt[Just us,Just it]- | stock it > 0= [us',it'] `debug` "john buy a PC"- | otherwise = error "stock is empty for this product"- - where- us'= us{spent=spent us + price it}- it'= it{stock= stock it-1}--- buyIt _ = error "either the user or the item does not exist"---main= do- -- create resources (acces no resources and return two new Data objects defined in items)- withResources[]items-- --11 PCs are charged to the John´s account in paralel, to show transactionality- --because there are only 10 PCs in stock, the last thread must return an error-- for 11 $ forkIO $ User{uid="U12345"} `buy` Item{iid="I54321"}- - --wait 5 seconds - threadDelay 5000000-- [us,it] <- getResources [User{uid="U12345"}, Item{iid="I54321"}]- - print $ "user data=" ++ show us- print $ "item data=" ++ show it- - -- write the cache content in a persistent store (invoque writeResource for each resource)- -- in a real application clearSyncCacheProc can be used instead to adjust size and write the cache periodically-- syncCache (refcache :: Cache Data)-- -- the files have been created. the files U12345 and I54321 must contain the result of the 11 iterations-- where- items _=- [User "John" "U12345" 0- ,Item "PC" "I54321" 6000 10]- - for 0 _ = return () - for n f= f >> for (n-1) f
− Sample2.hs
@@ -1,91 +0,0 @@- module Main where----------------------------------------------------- A example of Transactional cache usage (TCache.hs)--- (Something like the Java Hibernate)--- Author: Alberto Gómez Corona Nov 2006--- Language: Haskell--- Terms of use: you can do whatever you want--- with this code as long as you keep this notice---------------------------------------------------import Data.TCache--import Control.Concurrent-import Debug.Trace--debug a b= trace b a----1 and 4: The data elements to be used in the example--data Data= Data Int String- - deriving (Read, Show)----3 The mappings between the cache and the phisical storage are defined by the interface IResource---- to extract the resource unique key, required---- to serialize/deserialize it into/from a String, required---- to define the prefix used for default persistence in files (if prefix have "/", a folder will be created)---- OPTINONAL:---- to read the resource from the physical storage, (default provided in file)---- to store it (default provided)---- to delete the resource from the physical storage. (default provided)-- --instance IResource Data where- keyResource (Data i _)= show i - serialize x= show x- deserialize x= read x- defPath _ = "data/" -- directory where the data is stored.- - -- other definable methods: readResource, writeResource delResource. here the default persistence in files are used- --- buy is the operation to be performed in the example----4 withResources gets a partial definition of each resource necessary for extracting the key, ---fill all the rest of the data structures (if found ) and return a list of Maybe Data. ---BuyIt is part of the domain problem. it receive this list and generates a new list of ---data objects that are updated in the cache. buyIt is executed atomically.------main= do- --asyncronous write every 10 seconds, 100 elems max cache- clearSyncCacheProc (refcache :: Cache Data) 10 defaultCheck 100 - - -- create resources (- -- (acces no resources and return two new Data objects defined in items)- withResources[] (\_ ->[Data i "olddata" | i <-[1..200]])- - -- after 10 seconds, 200 files have been created in the folder "data"- -- because 200 exceeds the maximum cache size (100) defaultCheck will discard - -- then 150 first and older elems from cache to reduce it to a half.- - - -- wait 20 seconds - - threadDelay 20000000- - - print "modifyng"- --update all the list. discarded elems from cache are also updated atomically- withResources[] (\_ ->[Data i "newdata" | i <-[1..200]]) - --state in disk is also atomically written.- - - - threadDelay 20000000- - ---
TCache.cabal view
@@ -1,43 +1,57 @@ name: TCache-version: 0.5.5-synopsis: A Transactional data cache with configurable persistence -description: - Data.Tcache is a transactional cache with configurable persistence. It tries to simulate Hibernate - for Java or Rails for Ruby. The main difference is that transactions are done in memory trough STM. +version: 0.6.4+synopsis: A Transactional data cache with configurable persistence+description:+ Data.Tcache is a transactional cache with configurable persistence. It tries to simulate Hibernate+ for Java or Rails for Ruby. The main difference is that transactions are done in memory trough STM. There are transactional cache implementations for some J2EE servers like JBOSS.-- TCache uses STM. It can atomically apply a function to a list of cached objects. The resulting - objects go back to the cache (withResources). It also can retrieve these objects (getResources). - Persistence can be syncronous (syncCache) or asyncronous, wtih configurable time between cache - writes and configurable cache clearance strategy. the size of the cache can be configured too . - All of this can be done trough clearSyncCacheProc. Even the TVar variables can be accessed - directly (getTVar) to acceess all the semantic of atomic blocks while maintaining the persistence of the + .+ TCache uses STM. It can atomically apply a function to a list of cached objects. The resulting+ objects go back to the cache (withResources). It also can retrieve these objects (getResources).+ Persistence can be syncronous (syncCache) or asyncronous, wtih configurable time between cache+ writes and configurable cache clearance strategy. the size of the cache can be configured too .+ All of this can be done trough clearSyncCacheProc. Even the TVar variables can be accessed+ directly (getTVar) to acceess all the semantic of atomic blocks while maintaining the persistence of the TVar updates.-+ . Persistence can be defined for each object: Each object must have a defined key, a default filename- path (if applicable). Persistence is pre-defined in files, but the readResource writeResource and + path (if applicable). Persistence is pre-defined in files, but the readResource writeResource and delResource methods can be redefined to persist in databases or whatever.-+ .+ Serialization is also configurable.+ . There are Samples here that explain the main features.- - - In this release:- Added a Data.TCache.Dynamic. (SEE dynamicsample.hs)- - Can handle, transact, and serialize to disk many datatypes simultaneously and incrementally- - Dynamic uses the same interface than TCache and add *DResource(s) calls - - Safe dynamic data handling trough a lighter, indexable and serializable version of Data.Dynamic- - Added KEY object for retrieving any object of any type.+ . + In this release+ .+ * added withSTMResources. Most of the rest of the methods are derived from withSTMResources . the results are returned in the STM monad, so this method can be part of al larger STM transaction+ It also can perforn used defined retries.+ .+ * added modules for cached TMVars+ Data.TCache.TMVar and Data.TCache.TMVar.Dynamic uses TMVars instead of TVars (See Control.Concurrent.STM.TMVar)+ .+ It is not possible tu mix TVars and TMVars packages in the same executable. However code that uses dynamic and non dynamic can+ can be mixed+ .+ * Data.TCache - cached TVars of object of type a.+ .+ * Data.TCache.Dynamic - cached TVars of objects of type IDynamic.+ .+ * Data.TCache.TMVar - cached TMVars of objects of type a.+ .+ * Data.TCache..TMVar.Dynamic - cached TMVars of objects of type IDynamic. -category: Middleware++category: Middleware, Data, Database, Concurrency license: BSD3 license-file: LICENSE author: Alberto Gómez Corona maintainer: agocorona@gmail.com Tested-With: GHC == 6.8.2 Build-Type: Simple-build-Depends: base >=3 && <4,directory >= 1.0, old-time >=1.0,stm>=2+build-Depends: base >=3 && <4,directory >= 1.0, old-time >=1.0,stm>=2, containers>=0.1.0.1, RefSerialize >= 0.2.4 Cabal-Version: >= 1.2 -exposed-modules: Data.TCache, Data.TCache.Dynamic-ghc-options: +exposed-modules: Data.TCache, Data.TCache.IResource, Data.TCache.Dynamic, Data.TCache.TMVar, Data.TCache.TMVar.Dynamic, Data.TCache.IDynamic+ghc-options: -O2
+ demos/DynamicSample.hs view
@@ -0,0 +1,71 @@+{-# OPTIONS -XTypeSynonymInstances #-} +-- XTypeSynonymInstances added only to permit IResource instances for Strings +module Main where +import Data.TCache.Dynamic +import Data.Typeable +import Unsafe.Coerce +{------------- tests--------- +example of IDynamic usage. + +-} + +--very simple data: +--two objects with two different datatypes: Int and String + +instance IResource Int where + keyResource x= "I" + serialize = show + deserialize = read + defPath _= "data/" + + + +instance IResource String where + keyResource x= "S" + serialize = show + deserialize = read + defPath _= "data/" + + + + +main= do + putStrLn "see the code to know the meaning of he results" + registerType :: IO Int -- register both datatypes (Int, and String) + registerType :: IO String + + let x= 1:: Int + withDResources [] (\_->[toIDyn x, toIDyn "hola"]) --resource creation for the example + + syncCache --syncCache now has no parameters (refcache is not used) + + res <- getResources [1::Int, 1::Int] --getResources works as allways + print (res :: [Maybe Int]) + + res <- getResources ["hola", "hola"] --with multiple stored datatypes this time + print (res :: [Maybe String]) + + res <- getDResources [toIDyn "hola", toIDyn ( 1::Int)] -- DResource calls can manage many datatypes simultaneously + print res + + mres <- getResource $ Key (typeOf "") "S" --Key permits to retrieve any object of any datatype by key + case mres of + Nothing -> error "not found" + Just res -> do + print ( res :: String) -- print the content + + -- print ( res :: Int) -- error reported, wrong casting + + + mres <- getDResource $ IDynamic $ Key (typeOf "") "S" --Key permits to retrieve any object of any datatype by key + case mres of + Nothing -> error "not found" + Just res -> do + print (fromIDyn res :: String) -- print the content + + print (fromIDyn res :: Int) -- error reported, wrong casting + + + syncCache + + getChar
+ demos/Sample.hs view
@@ -0,0 +1,102 @@+ module Main where+-------------------------------------------------+-- A example of Transactional cache usage (TCache.hs)+-- (Something like the Java Hibernate)+-- Author: Alberto Gómez Corona Nov 2006+-- Language: Haskell+-- Terms of use: you can do whatever you want+-- with this code as long as you keep this notice+------------------------------------------------+++import Data.TCache++import Control.Concurrent+import Debug.Trace++debug a b= trace b a++-- The data elements to be used in the example: A user will repeatedly buy Items.++data Data= User{uname::String, uid::String, spent:: Int} |+ Item{iname::String, iid::String, price::Int, stock::Int}++ deriving (Read, Show)+++-- The mappings between the cache and the phisical storage are defined by the interface IResource+-- to extract the unique key,+-- to serializa to string+-- to deserialize from string+-- key prefix (or , if use "/", directory where to store the resource if default write is to be used)+-- to read the resource from the physical storage, (optional, default in files)+-- to store it (optional, default from file)+-- to delete the resource from the physical storage. (optional. Default provided)++++instance IResource Data where+ keyResource User{uid=id}= id+ keyResource Item{iid=id}= id+ serialize x= show x+ deserialize x= read x+ defPath _ = "data/" -- directory where the data is stored.++ -- other definable methods: readResource, writeResource delResource. here the default persistence in files are used++-- buy is the operation to be performed in the example++--withResources gets a partial definition of each resource necessary for extracting the key,+--fill all the rest of the data structures (if found ) and return a list of Maybe Data.+--BuyIt is part of the domain problem. it receive this list and generates a new list of+--data objects that are updated in the cache. buyIt is executed atomically.+++user `buy` item=+ withResources[user,item] buyIt++ where++ buyIt[Just us,Just it]+ | stock it > 0= [us',it'] `debug` "john buy a PC"+ | otherwise = error "stock is empty for this product"++ where+ us'= us{spent=spent us + price it}+ it'= it{stock= stock it-1}+++ buyIt _ = error "either the user or the item does not exist"+++main= do+ -- create resources (acces no resources and return two new Data objects defined in items)+ withResources[]items++ --11 PCs are charged to the John´s account in paralel, to show transactionality+ --because there are only 10 PCs in stock, the last thread must return an error++ for 11 $ forkIO $ User{uid="U12345"} `buy` Item{iid="I54321"}++ --wait 1 seconds+ threadDelay 1000000++ [us,it] <- getResources [User{uid="U12345"}, Item{iid="I54321"}]++ putStrLn $ "user data=" ++ show us+ putStrLn $ "item data=" ++ show it++ -- write the cache content in a persistent store (invoque writeResource for each resource)+ -- in a real application clearSyncCacheProc can be used instead to adjust size and write the cache periodically++ syncCache (refcache :: Cache Data)++ -- the files have been created. the files U12345 and I54321 must contain the result of the 11 iterations++ where+ items _=+ [User "John" "U12345" 0+ ,Item "PC" "I54321" 6000 10]++ for 0 _ = return ()+ for n f= f >> for (n-1) f
+ demos/Sample2.hs view
@@ -0,0 +1,67 @@+ module Main where+-------------------------------------------------+-- A example of Transactional cache usage (TCache.hs)+-- (Something like the Java Hibernate)+-- Author: Alberto Gómez Corona Nov 2006+-- Language: Haskell+-- Terms of use: you can do whatever you want+-- with this code as long as you keep this notice+------------------------------------------------++import Data.TCache.TMVar++import Control.Concurrent+import Debug.Trace++debug a b= trace b a++-- The data elements to be used in the example++data Data= Data Int String deriving (Read, Show)++ ++instance IResource Data where+ keyResource (Data i _)= show i + serialize x= show x+ deserialize x= read x+ defPath _ = "data/" -- directory where the data is stored.+ + -- other definable methods: readResource, writeResource delResource. here the default persistence in files are used+ +++main= do+ + putStrLn "see the source code of this example"+ putStrLn "This program test the caching and cleaning and re-retrieval and update of the cache"+ + putStrLn "asyncronous write every 10 seconds, 100 elems max cache size"+ putStrLn "default policy (defaultCheck) for clearing the cache is to reduce the cache to half of max sixe when size exceeds the max"+ clearSyncCacheProc (refcache :: Cache Data) 10 defaultCheck 100 + putStrLn ""+ putStrLn "create resources" + putStrLn " (acces no resources and return two new Data objects defined in items)"+ withResources[] (\_ ->[Data i "olddata" | i <-[1..200]])++ putStrLn ""+ putStrLn "after 10 seconds, 200 files have been created in the folder \"data\""+ putStrLn "because 200 exceeds the maximum cache size (100) defaultCheck will discard the 150 older elems to reduce the cache to a half"+ putStrLn "This is the behaviour defined in defaultCheck."+ + putStrLn ""+ putStrLn" wait 20 seconds to let the next write cycle to enter (every 10 seconds, set in clearSyncCacheProc)" + + threadDelay 2000000+ + putStrLn "" + putStrLn "modifyng"+ putStrLn "update all the list. discarded elems from cache are also updated atomically"+ withResources[] (\_ ->[Data i "newdata" | i <-[1..200]]) + + putStrLn "state in disk is also atomically written."+ + putStrLn "" + putStrLn "updated. wait 20 seconds to let the next write cycle to enter (every 10 seconds)" + threadDelay 20000000+ putStrLn "Done. Please check that the \".data/\" directory has 200 files with \"newdata\" content in them"
+ dist/build/autogen/Paths_TCache.hs view
@@ -0,0 +1,29 @@+module Paths_TCache (+ version,+ getBinDir, getLibDir, getDataDir, getLibexecDir,+ getDataFileName+ ) where++import Data.Version (Version(..))+import System.Environment (getEnv)++version :: Version+version = Version {versionBranch = [0,6,4], versionTags = []}++bindir, libdir, datadir, libexecdir :: FilePath++bindir = "C:\\Archivos de programa\\Haskell\\bin"+libdir = "C:\\Archivos de programa\\Haskell\\TCache-0.6.4\\ghc-6.10.3"+datadir = "C:\\Archivos de programa\\Haskell\\TCache-0.6.4"+libexecdir = "C:\\Archivos de programa\\Haskell\\TCache-0.6.4"++getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath+getBinDir = catch (getEnv "TCache_bindir") (\_ -> return bindir)+getLibDir = catch (getEnv "TCache_libdir") (\_ -> return libdir)+getDataDir = catch (getEnv "TCache_datadir") (\_ -> return datadir)+getLibexecDir = catch (getEnv "TCache_libexecdir") (\_ -> return libexecdir)++getDataFileName :: FilePath -> IO FilePath+getDataFileName name = do+ dir <- getDataDir+ return (dir ++ "\\" ++ name)
+ dist/build/autogen/cabal_macros.h view
@@ -0,0 +1,38 @@+/* DO NOT EDIT: This file is automatically generated by Cabal */++/* package RefSerialize-0.2.4 */+#define MIN_VERSION_RefSerialize(major1,major2,minor) \+ (major1) < 0 || \+ (major1) == 0 && (major2) < 2 || \+ (major1) == 0 && (major2) == 2 && (minor) <= 4++/* package base-3.0.3.1 */+#define MIN_VERSION_base(major1,major2,minor) \+ (major1) < 3 || \+ (major1) == 3 && (major2) < 0 || \+ (major1) == 3 && (major2) == 0 && (minor) <= 3++/* package containers-0.2.0.1 */+#define MIN_VERSION_containers(major1,major2,minor) \+ (major1) < 0 || \+ (major1) == 0 && (major2) < 2 || \+ (major1) == 0 && (major2) == 2 && (minor) <= 0++/* package directory-1.0.0.3 */+#define MIN_VERSION_directory(major1,major2,minor) \+ (major1) < 1 || \+ (major1) == 1 && (major2) < 0 || \+ (major1) == 1 && (major2) == 0 && (minor) <= 0++/* package old-time-1.0.0.2 */+#define MIN_VERSION_old_time(major1,major2,minor) \+ (major1) < 1 || \+ (major1) == 1 && (major2) < 0 || \+ (major1) == 1 && (major2) == 0 && (minor) <= 0++/* package stm-2.1.1.2 */+#define MIN_VERSION_stm(major1,major2,minor) \+ (major1) < 2 || \+ (major1) == 2 && (major2) < 1 || \+ (major1) == 2 && (major2) == 1 && (minor) <= 1+
+ dist/doc/html/TCache/Data-TCache-Dynamic.html view
@@ -0,0 +1,2627 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.Dynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache-Dynamic.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache.Dynamic</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Data.TCache.Dynamic: +A dynamic interface for TCache so that mixed datatypes can be managed participating in a single transaction. +The objects are encapsulated in a <TT +><A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TT +> datatype, that is d Dynamic type that is serializable and indexable +</P +><P +>Dynamic present essentially the same methods than Data.TCache. The added functionality is the management +of IDynamic types. Any datatype that is instance of IResource and Typeable can be handled mixed with any other +datatype. TCache.Dynamic is essentially a TCache working with a single datatype: IDynamic that is indexable and +serializable. You dont need to do anything special except to define Typeable besides the IResource instance for +your particular datatype. Also, before use, your datatype must be registered (with <TT +><A HREF="Data-TCache-Dynamic.html#v%3AregisterType" +>registerType</A +></TT +>, see example in the package). +</P +><P +>there are basically two types of methods in this module: +</P +><UL +><LI +> <TT +>with(STM)Resource(s)</TT +> calls: manage one single type of data, in the same way than the naked <TT +>Data.TCache</TT +> module, Are the same than Data.TCache. + The marsalling to and from IDynamic is managed internally. These calls do exactly the same than the TCache calls with the same name +these cals allows different modules to handle their particular kind of data without regard that it is being handled in the same cache with other datatypes. +</LI +><LI +> <TT +>wthD(STM)Resource(s)</TT +>: are new, and handle the IDynamic type. The user must wrap your datatypes (with toIDyn) and unwap it (with fromIDyn) + These call permts to handle arbitrary types at the same time and partticipate in transactions. +</LI +></UL +><P +>There is also a useful <TT +><A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Key</A +></TT +> object whose purpose is to retrieve any objecto fo any datatype by its sting key +</P +><P +>Also the parameter <TT +>refcache</TT +> has been dropped from the methods that used it (the syncronization methods) +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AIResource" +>IResource</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AkeyResource" +>keyResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aserialize" +>serialize</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adeserialize" +>deserialize</A +> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atshowp" +>tshowp</A +> :: a -> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atreadp" +>treadp</A +> :: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefPath" +>defPath</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadResource" +>readResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteResource" +>writeResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdelResource" +>delResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AResources" +>Resources</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARetry" +>Retry</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AResources" +>Resources</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoAdd" +>toAdd</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoDelete" +>toDelete</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoReturn" +>toReturn</A +> :: b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresources" +>resources</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetCache" +>setCache</A +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arefcache" +>refcache</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefaultCheck" +>defaultCheck</A +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIDynamic" +>IDynamic</A +> = <SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => <A HREF="#v%3AIDynamic" +>IDynamic</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ACache" +>Cache</A +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3ADynamicInterface" +>DynamicInterface</A +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoIDyn" +>toIDyn</A +> :: x -> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AregisterType" +>registerType</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromIDyn" +>fromIDyn</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AunsafeFromIDyn" +>unsafeFromIDyn</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsafeFromIDyn" +>safeFromIDyn</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> x</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AKey" +>Key</A +> = <A HREF="#v%3AKey" +>Key</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTVars" +>getTVars</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreleaseTVars" +>releaseTVars</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTVarsIO" +>getTVarsIO</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDResource" +>withDResource</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDResources" +>withDResources</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDSTMResources" +>withDSTMResources</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDResource" +>getDResource</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDResources" +>getDResources</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteDResource" +>deleteDResource</A +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteDResources" +>deleteDResources</A +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsyncCache" +>syncCache</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AclearSyncCacheProc" +>clearSyncCacheProc</A +> :: <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> (<A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResource" +>withResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> b) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResources" +>withResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [b]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithSTMResources" +>withSTMResources</A +> :: <SPAN CLASS="keyword" +>forall</SPAN +> x a b. (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> b x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResource" +>getResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResources" +>getResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResource" +>deleteResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResources" +>deleteResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:IResource" +><A NAME="t%3AIResource" +></A +></A +><B +>IResource</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Interface that must be defined for every object being cached. + <TT +><A HREF="Data-TCache-Dynamic.html#v%3AreadResource" +>readResource</A +></TT +> and <TT +><A HREF="Data-TCache-Dynamic.html#v%3AwriteResource" +>writeResource</A +></TT +> are implemented by default as read-write to files with its key as filename + <TT +><A HREF="Data-TCache-Dynamic.html#v%3Aserialize" +>serialize</A +></TT +> and <TT +><A HREF="Data-TCache-Dynamic.html#v%3Adeserialize" +>deserialize</A +></TT +> are specified just to allow these defaults. If you define your own persistence, then + <TT +>serialize</TT +> and <TT +>deserialize</TT +> are not needed. The package Workflow need them anyway. +</P +><P +>minimal definition: keyResource, serialize, deserialize +</P +><P +>While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and +tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined +by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be +serialized as part of larger structures that embody them. This is necessary for the Workdlow package. +</P +><P +>The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example: +</P +><PRE +>data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s</PRE +><P +>the data being accesed must have the fields used by keyResource filled. For example +</P +><PRE +> readResource Person {name=<A HREF="John.html" +>John</A +>, surname= <A HREF="Adams.html" +>Adams</A +>}</PRE +><P +>leaving the rest of the fields undefined +</P +><P +>IResource has defaults definitions for all the methods except keyResource + Either one or other serializer must be defiened for default witeResource, readResource and delResource +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:keyResource" +><A NAME="v%3AkeyResource" +></A +></A +><B +>keyResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:serialize" +><A NAME="v%3Aserialize" +></A +></A +><B +>serialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deserialize" +><A NAME="v%3Adeserialize" +></A +></A +><B +>deserialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:tshowp" +><A NAME="v%3Atshowp" +></A +></A +><B +>tshowp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>serializer in the RefSerialize monad. Either one or other serializer must be defined to use default persistence +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:treadp" +><A NAME="v%3Atreadp" +></A +></A +><B +>treadp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +><TD CLASS="rdoc" +>deserialize in the RefSerilzlize monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defPath" +><A NAME="v%3AdefPath" +></A +></A +><B +>defPath</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>additional extension for default file paths or key prefixes +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:readResource" +><A NAME="v%3AreadResource" +></A +></A +><B +>readResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:writeResource" +><A NAME="v%3AwriteResource" +></A +></A +><B +>writeResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:delResource" +><A NAME="v%3AdelResource" +></A +></A +><B +>delResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IResource')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IResource" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Resources" +><A NAME="t%3AResources" +></A +></A +><B +>Resources</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Resources returned by withSTMResources' +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Retry" +><A NAME="v%3ARetry" +></A +></A +><B +>Retry</B +></TD +><TD CLASS="rdoc" +>forces a retry +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Resources" +><A NAME="v%3AResources" +></A +></A +><B +>Resources</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:toAdd" +><A NAME="v%3AtoAdd" +></A +></A +><B +>toAdd</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be inserted back in the cache +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toDelete" +><A NAME="v%3AtoDelete" +></A +></A +><B +>toDelete</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be deleted from the cache and from permanent storage +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toReturn" +><A NAME="v%3AtoReturn" +></A +></A +><B +>toReturn</B +> :: b</TD +><TD CLASS="rdoc" +>result to be returned +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:resources" +><A NAME="v%3Aresources" +></A +></A +><B +>resources</B +> :: <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>resources= Resources [] [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:setCache" +><A NAME="v%3AsetCache" +></A +></A +><B +>setCache</B +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>set the cache. this is useful for hot loaded modules that will update an existing cache. Experimental +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:refcache" +><A NAME="v%3Arefcache" +></A +></A +><B +>refcache</B +> :: <A HREF="Data-TCache-Dynamic.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defaultCheck" +><A NAME="v%3AdefaultCheck" +></A +></A +><B +>defaultCheck</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>current time in seconds +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>last access time for a given object +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>last cache syncronization (with the persisten storage) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +><TD CLASS="rdoc" +>return true for all the elems not accesed since half the time between now and the last sync +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>To drop from the cache all the elems not accesed since half the time between now and the last sync + ths is a default cache clearance procedure -- it is invoke when the cache size exceeds the defined in <TT +><A HREF="Data-TCache.html#v%3AclearSyncCacheProc" +>clearSyncCacheProc</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:IDynamic" +><A NAME="t%3AIDynamic" +></A +></A +><B +>IDynamic</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => <A NAME="v:IDynamic" +><A NAME="v%3AIDynamic" +></A +></A +><B +>IDynamic</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IDynamic')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IDynamic" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:Cache" +><A NAME="t%3ACache" +></A +></A +><B +>Cache</B +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:DynamicInterface" +><A NAME="t%3ADynamicInterface" +></A +></A +><B +>DynamicInterface</B +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:toIDyn" +><A NAME="v%3AtoIDyn" +></A +></A +><B +>toIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: x</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +>encapsulates data in a dynamic object +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:registerType" +><A NAME="v%3AregisterType" +></A +></A +><B +>registerType</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +><TD CLASS="rdoc" +>registers the deserialize, readp and readResource methods for this data type +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:fromIDyn" +><A NAME="v%3AfromIDyn" +></A +></A +><B +>fromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>extract the data from the dynamic object. trows a user error when the cast fails +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:unsafeFromIDyn" +><A NAME="v%3AunsafeFromIDyn" +></A +></A +><B +>unsafeFromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>unsafe version. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:safeFromIDyn" +><A NAME="v%3AsafeFromIDyn" +></A +></A +><B +>safeFromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> x</TD +><TD CLASS="rdoc" +>safe extraction with Maybe +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Key" +><A NAME="t%3AKey" +></A +></A +><B +>Key</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Key datatype can be used to read any object trough the Dynamic interface. +</P +><PRE +> data Key = Key <TT +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +></TT +> String deriving Typeable</PRE +><P +>Example +</P +><PRE +> mst <- getDResource $ <TT +><A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Key</A +></TT +> type keyofDesiredObject + case mst of + Nothing -> error $ "not found "++ key + Just (idyn) -> fromIDyn idyn :: DesiredDatatype}</PRE +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Key" +><A NAME="v%3AKey" +></A +></A +><B +>Key</B +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Key')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Key" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTVars" +><A NAME="v%3AgetTVars" +></A +></A +><B +>getTVars</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)]</TD +></TR +><TR +><TD CLASS="doc" +>getTVars return the TVar that wraps the resources for which the keys are given . + | it return <TT +>Nothing</TT +> if a TVar with this object has not been allocated + These TVars can be used as usual in explicit user constructed atomic blocks + Additionally, the retrieved TVars remain in the cache and can be accessed and updated by the rest + of the TCache methods. + to keep the consistence in the serialized data, the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called + See Data.TCache.getTVars +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:releaseTVars" +><A NAME="v%3AreleaseTVars" +></A +></A +><B +>releaseTVars</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTVarsIO" +><A NAME="v%3AgetTVarsIO" +></A +></A +><B +>getTVarsIO</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDResource" +><A NAME="v%3AwithDResource" +></A +></A +><B +>withDResource</B +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>handles Dynamic objects using <TT +>Data.TCache.withResource</TT +> +</P +><PRE +>withDResource = Data.TCache..withResource</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDResources" +><A NAME="v%3AwithDResources" +></A +></A +><B +>withDResources</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDSTMResources" +><A NAME="v%3AwithDSTMResources" +></A +></A +><B +>withDSTMResources</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: </TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +><TD CLASS="rdoc" +>The list of resources to be retrieved +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> x</TD +><TD CLASS="rdoc" +>The function that process the resources found and return a Resources structure +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +><TD CLASS="rdoc" +>The return value in the STM monad. +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>this is the main function for the *Resource calls. All the rest derive from it. The results are kept in the STM monad + so it can be part of a larger STM transaction involving other TVars + The <TT +>Resources</TT +> register returned by the user-defined function is interpreted as such: +</P +><P +><TT +>toAdd</TT +>: additional resources not read in the first parameter of withSTMResources are created/updated with toAdd +</P +><P +><TT +>toDelete</TT +>: from the cache and from permanent storage +</P +><P +><TT +>toReturn</TT +>: will be returned by withSTMResources +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getDResource" +><A NAME="v%3AgetDResource" +></A +></A +><B +>getDResource</B +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)</TD +></TR +><TR +><TD CLASS="doc" +><PRE +>getDResource = Data.TCache.getResource</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getDResources" +><A NAME="v%3AgetDResources" +></A +></A +><B +>getDResources</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="doc" +><PRE +>getDResources = Data.TCache.getResources</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteDResource" +><A NAME="v%3AdeleteDResource" +></A +></A +><B +>deleteDResource</B +> :: <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>retrieve a list of objects and return error if any resource is not found. instead of Nothing +</P +><P +>delete a resource from the cache and the storage +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteDResources" +><A NAME="v%3AdeleteDResources" +></A +></A +><B +>deleteDResources</B +> :: [<A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>delete a list of resources from the cache and the storage +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:syncCache" +><A NAME="v%3AsyncCache" +></A +></A +><B +>syncCache</B +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:clearSyncCacheProc" +><A NAME="v%3AclearSyncCacheProc" +></A +></A +><B +>clearSyncCacheProc</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>number of seconds betwen checks. objects not written to disk are written +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +><TD CLASS="rdoc" +>The user-defined check-for-cleanup-from-cache for each object. defaultCheck is an example +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>The max number of objects in the cache, if more, the cleanup starts +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +><TD CLASS="rdoc" +>Identifier of the thread created +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>Start the thread that clean and writes on the persistent storage. + Otherwise, syncCache must be invoked explicitly or no persistence will exist +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResource" +><A NAME="v%3AwithResource" +></A +></A +><B +>withResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> b) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>methods that handle a single datatype. +</P +><P +>similar to <TT +>Data.TCache.withResource</TT +>. + The fact that this method may return a type different that the source type permits to use ' Key' objects +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResources" +><A NAME="v%3AwithResources" +></A +></A +><B +>withResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [b]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>similar to <TT +>Data.TCache.withResources</TT +>. + The fact that this method may return a type different that the source type permits to use ' Key' objects +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withSTMResources" +><A NAME="v%3AwithSTMResources" +></A +></A +><B +>withSTMResources</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <SPAN CLASS="keyword" +>forall</SPAN +> x a b . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [a]</TD +><TD CLASS="rdoc" +>the list of resources to be retrieved +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Resources</A +> b x</TD +><TD CLASS="rdoc" +>The function that process the resources found and return a Resources structure +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +><TD CLASS="rdoc" +>The return value in the STM monad. +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>similar to <TT +>Data.TCache.withSTMResources</TT +>. + The return in the STM monad permits to participate in larger STM transactions + The fact that this method may return a type different that the source type permits to use ' Key' objects +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResource" +><A NAME="v%3AgetResource" +></A +></A +><B +>getResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="doc" +>similar to Data.<TT +>TCache.getResource</TT +>. + The fact that this method may return a type different that the source type permits to use ' Key' objects +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResources" +><A NAME="v%3AgetResources" +></A +></A +><B +>getResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b]</TD +></TR +><TR +><TD CLASS="doc" +>similar to <TT +>Data.TCache.getResources</TT +>. + The fact that this method may return a type different that the source type permits to use ' Key' objects +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResource" +><A NAME="v%3AdeleteResource" +></A +></A +><B +>deleteResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>similar to <TT +>Data.TCache.deleteResource</TT +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResources" +><A NAME="v%3AdeleteResources" +></A +></A +><B +>deleteResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>IResource</A +> a) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>similar to <TT +>Data.TCache.deleteResource</TT +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/Data-TCache-IDynamic.html view
@@ -0,0 +1,672 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.IDynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache-IDynamic.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache.IDynamic</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>IDynamic is a indexable and serializable version of Dynamic. (See <TT +>Data.Dynamic</TT +>). It is used as containers of objects +in the cache so any new datatype can be incrementally stored without recompilation. +IDimamic provices methods for safe casting, besides serializaton, deserialization, registrations and retrieval by lkey. +</P +><PRE +>data IDynamic= forall a. (Typeable a, IResource a) => IDynamic a deriving Typeable</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIDynamic" +>IDynamic</A +> = <SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> a) => <A HREF="#v%3AIDynamic" +>IDynamic</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Alist" +>list</A +> :: <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent-MVar.html#t%3AMVar" +>MVar</A +> (<A HREF="$httptopdir/doc/libraries/containers/Data-Map.html#t%3AMap" +>Map</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Word.html#t%3AWord" +>Word</A +> (<A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>), <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>, <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>))</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3ADynamicInterface" +>DynamicInterface</A +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoIDyn" +>toIDyn</A +> :: x -> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AregisterType" +>registerType</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromIDyn" +>fromIDyn</A +> :: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AunsafeFromIDyn" +>unsafeFromIDyn</A +> :: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsafeFromIDyn" +>safeFromIDyn</A +> :: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> x</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AKey" +>Key</A +> = <A HREF="#v%3AKey" +>Key</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:IDynamic" +><A NAME="t%3AIDynamic" +></A +></A +><B +>IDynamic</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> a) => <A NAME="v:IDynamic" +><A NAME="v%3AIDynamic" +></A +></A +><B +>IDynamic</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IDynamic')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IDynamic" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:list" +><A NAME="v%3Alist" +></A +></A +><B +>list</B +> :: <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent-MVar.html#t%3AMVar" +>MVar</A +> (<A HREF="$httptopdir/doc/libraries/containers/Data-Map.html#t%3AMap" +>Map</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Word.html#t%3AWord" +>Word</A +> (<A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>), <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>, <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +>))</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:DynamicInterface" +><A NAME="t%3ADynamicInterface" +></A +></A +><B +>DynamicInterface</B +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:toIDyn" +><A NAME="v%3AtoIDyn" +></A +></A +><B +>toIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: x</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +>encapsulates data in a dynamic object +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:registerType" +><A NAME="v%3AregisterType" +></A +></A +><B +>registerType</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +><TD CLASS="rdoc" +>registers the deserialize, readp and readResource methods for this data type +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:fromIDyn" +><A NAME="v%3AfromIDyn" +></A +></A +><B +>fromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>extract the data from the dynamic object. trows a user error when the cast fails +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:unsafeFromIDyn" +><A NAME="v%3AunsafeFromIDyn" +></A +></A +><B +>unsafeFromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>unsafe version. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:safeFromIDyn" +><A NAME="v%3AsafeFromIDyn" +></A +></A +><B +>safeFromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> x</TD +><TD CLASS="rdoc" +>safe extraction with Maybe +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Key" +><A NAME="t%3AKey" +></A +></A +><B +>Key</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Key datatype can be used to read any object trough the Dynamic interface. +</P +><PRE +> data Key = Key <TT +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +></TT +> String deriving Typeable</PRE +><P +>Example +</P +><PRE +> mst <- getDResource $ <TT +><A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TT +> type keyofDesiredObject + case mst of + Nothing -> error $ "not found "++ key + Just (idyn) -> fromIDyn idyn :: DesiredDatatype}</PRE +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Key" +><A NAME="v%3AKey" +></A +></A +><B +>Key</B +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Key')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Key" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/Data-TCache-IResource.html view
@@ -0,0 +1,844 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.IResource</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache-IResource.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache.IResource</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AIResource" +>IResource</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AkeyResource" +>keyResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aserialize" +>serialize</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adeserialize" +>deserialize</A +> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atshowp" +>tshowp</A +> :: a -> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atreadp" +>treadp</A +> :: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefPath" +>defPath</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadResource" +>readResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteResource" +>writeResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdelResource" +>delResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AAccessTime" +>AccessTime</A +> = <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3AModifTime" +>ModifTime</A +> = <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AResources" +>Resources</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARetry" +>Retry</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AResources" +>Resources</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoAdd" +>toAdd</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoDelete" +>toDelete</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoReturn" +>toReturn</A +> :: b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresources" +>resources</A +> :: <A HREF="Data-TCache-IResource.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:IResource" +><A NAME="t%3AIResource" +></A +></A +><B +>IResource</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Interface that must be defined for every object being cached. + <TT +><A HREF="Data-TCache-IResource.html#v%3AreadResource" +>readResource</A +></TT +> and <TT +><A HREF="Data-TCache-IResource.html#v%3AwriteResource" +>writeResource</A +></TT +> are implemented by default as read-write to files with its key as filename + <TT +><A HREF="Data-TCache-IResource.html#v%3Aserialize" +>serialize</A +></TT +> and <TT +><A HREF="Data-TCache-IResource.html#v%3Adeserialize" +>deserialize</A +></TT +> are specified just to allow these defaults. If you define your own persistence, then + <TT +>serialize</TT +> and <TT +>deserialize</TT +> are not needed. The package Workflow need them anyway. +</P +><P +>minimal definition: keyResource, serialize, deserialize +</P +><P +>While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and +tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined +by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be +serialized as part of larger structures that embody them. This is necessary for the Workdlow package. +</P +><P +>The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example: +</P +><PRE +>data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s</PRE +><P +>the data being accesed must have the fields used by keyResource filled. For example +</P +><PRE +> readResource Person {name=<A HREF="John.html" +>John</A +>, surname= <A HREF="Adams.html" +>Adams</A +>}</PRE +><P +>leaving the rest of the fields undefined +</P +><P +>IResource has defaults definitions for all the methods except keyResource + Either one or other serializer must be defiened for default witeResource, readResource and delResource +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:keyResource" +><A NAME="v%3AkeyResource" +></A +></A +><B +>keyResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:serialize" +><A NAME="v%3Aserialize" +></A +></A +><B +>serialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deserialize" +><A NAME="v%3Adeserialize" +></A +></A +><B +>deserialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:tshowp" +><A NAME="v%3Atshowp" +></A +></A +><B +>tshowp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>serializer in the RefSerialize monad. Either one or other serializer must be defined to use default persistence +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:treadp" +><A NAME="v%3Atreadp" +></A +></A +><B +>treadp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +><TD CLASS="rdoc" +>deserialize in the RefSerilzlize monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defPath" +><A NAME="v%3AdefPath" +></A +></A +><B +>defPath</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>additional extension for default file paths or key prefixes +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:readResource" +><A NAME="v%3AreadResource" +></A +></A +><B +>readResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:writeResource" +><A NAME="v%3AwriteResource" +></A +></A +><B +>writeResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:delResource" +><A NAME="v%3AdelResource" +></A +></A +><B +>delResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IResource')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IResource" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-IResource.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:AccessTime" +><A NAME="t%3AAccessTime" +></A +></A +><B +>AccessTime</B +> = <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:ModifTime" +><A NAME="t%3AModifTime" +></A +></A +><B +>ModifTime</B +> = <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Resources" +><A NAME="t%3AResources" +></A +></A +><B +>Resources</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Resources returned by withSTMResources' +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Retry" +><A NAME="v%3ARetry" +></A +></A +><B +>Retry</B +></TD +><TD CLASS="rdoc" +>forces a retry +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Resources" +><A NAME="v%3AResources" +></A +></A +><B +>Resources</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:toAdd" +><A NAME="v%3AtoAdd" +></A +></A +><B +>toAdd</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be inserted back in the cache +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toDelete" +><A NAME="v%3AtoDelete" +></A +></A +><B +>toDelete</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be deleted from the cache and from permanent storage +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toReturn" +><A NAME="v%3AtoReturn" +></A +></A +><B +>toReturn</B +> :: b</TD +><TD CLASS="rdoc" +>result to be returned +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:resources" +><A NAME="v%3Aresources" +></A +></A +><B +>resources</B +> :: <A HREF="Data-TCache-IResource.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>resources= Resources [] [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/Data-TCache-TMVar-Dynamic.html view
@@ -0,0 +1,2232 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.TMVar.Dynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache-TMVar-Dynamic.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache.TMVar.Dynamic</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +><P +>Data.TCache.TMVar.Dynamic: +A dynamic interface for TCache using TMVars +</P +><P +>Dynamic present essentially the same methods than Data.TCache. The added functionality is the management +of IDynamic types. Any datatype that is instance of IResource and Typeable can be handled mixed with any other +datatype. TCache.Dynamic is essentially a TCache working with a single datatype: IDynamic that is indexable and +serializable. You dont need to do anything special except to define the IResource and typeable instances for +your particular datatype. Also, before use, your datatype must be registered (with registerType, see example in the package). +</P +><P +>there are basically two types of methods: +</P +><UL +><LI +>*Resource(s) : manage one type of data, Are the same than Data.TCache. The marsalling to and from IDynamic is managed internally +</LI +><LI +>*DResource(s): handle the IDynamic type. you must wrap your datatype (with toIDyn) and unwap it (with fromIDyn) +</LI +></UL +><P +>The first set allows different modules to handle their particular kind of data without regard that it is being handled in the same cache with other datatypes. +</P +><P +>The second set allows to handle, transact etc with many datatypes at the same time. +</P +><P +>There is also a useful Key object whose purpose is to retrieve any objecto fo any datatype by its sting key +</P +><P +>Also the parameter refcache has been dropped from the methods that used it (the syncronization methods) +</P +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AIResource" +>IResource</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AkeyResource" +>keyResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aserialize" +>serialize</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adeserialize" +>deserialize</A +> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atshowp" +>tshowp</A +> :: a -> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atreadp" +>treadp</A +> :: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefPath" +>defPath</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadResource" +>readResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteResource" +>writeResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdelResource" +>delResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AResources" +>Resources</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARetry" +>Retry</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AResources" +>Resources</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoAdd" +>toAdd</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoDelete" +>toDelete</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoReturn" +>toReturn</A +> :: b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresources" +>resources</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetCache" +>setCache</A +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arefcache" +>refcache</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefaultCheck" +>defaultCheck</A +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AIDynamic" +>IDynamic</A +> = <SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => <A HREF="#v%3AIDynamic" +>IDynamic</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ACache" +>Cache</A +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3ADynamicInterface" +>DynamicInterface</A +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AtoIDyn" +>toIDyn</A +> :: x -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AregisterType" +>registerType</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AfromIDyn" +>fromIDyn</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AunsafeFromIDyn" +>unsafeFromIDyn</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> x</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AKey" +>Key</A +> = <A HREF="#v%3AKey" +>Key</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTMVars" +>getTMVars</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTMVarsIO" +>getTMVarsIO</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDResource" +>withDResource</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDResources" +>withDResources</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithDSTMResources" +>withDSTMResources</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDResource" +>getDResource</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetDResources" +>getDResources</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteDResource" +>deleteDResource</A +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteDResources" +>deleteDResources</A +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>syncCache</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>clearSyncCacheProc</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResource" +>withResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> b) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResources" +>withResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [b]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithSTMResources" +>withSTMResources</A +> :: <SPAN CLASS="keyword" +>forall</SPAN +> x a b. (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> b x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResource" +>getResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResources" +>getResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResource" +>deleteResource</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResources" +>deleteResources</A +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:IResource" +><A NAME="t%3AIResource" +></A +></A +><B +>IResource</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Interface that must be defined for every object being cached. + <TT +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AreadResource" +>readResource</A +></TT +> and <TT +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwriteResource" +>writeResource</A +></TT +> are implemented by default as read-write to files with its key as filename + <TT +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3Aserialize" +>serialize</A +></TT +> and <TT +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3Adeserialize" +>deserialize</A +></TT +> are specified just to allow these defaults. If you define your own persistence, then + <TT +>serialize</TT +> and <TT +>deserialize</TT +> are not needed. The package Workflow need them anyway. +</P +><P +>minimal definition: keyResource, serialize, deserialize +</P +><P +>While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and +tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined +by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be +serialized as part of larger structures that embody them. This is necessary for the Workdlow package. +</P +><P +>The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example: +</P +><PRE +>data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s</PRE +><P +>the data being accesed must have the fields used by keyResource filled. For example +</P +><PRE +> readResource Person {name=<A HREF="John.html" +>John</A +>, surname= <A HREF="Adams.html" +>Adams</A +>}</PRE +><P +>leaving the rest of the fields undefined +</P +><P +>IResource has defaults definitions for all the methods except keyResource + Either one or other serializer must be defiened for default witeResource, readResource and delResource +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:keyResource" +><A NAME="v%3AkeyResource" +></A +></A +><B +>keyResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:serialize" +><A NAME="v%3Aserialize" +></A +></A +><B +>serialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deserialize" +><A NAME="v%3Adeserialize" +></A +></A +><B +>deserialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:tshowp" +><A NAME="v%3Atshowp" +></A +></A +><B +>tshowp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>serializer in the RefSerialize monad. Either one or other serializer must be defined to use default persistence +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:treadp" +><A NAME="v%3Atreadp" +></A +></A +><B +>treadp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +><TD CLASS="rdoc" +>deserialize in the RefSerilzlize monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defPath" +><A NAME="v%3AdefPath" +></A +></A +><B +>defPath</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>additional extension for default file paths or key prefixes +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:readResource" +><A NAME="v%3AreadResource" +></A +></A +><B +>readResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:writeResource" +><A NAME="v%3AwriteResource" +></A +></A +><B +>writeResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:delResource" +><A NAME="v%3AdelResource" +></A +></A +><B +>delResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IResource')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IResource" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Resources" +><A NAME="t%3AResources" +></A +></A +><B +>Resources</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Resources returned by withSTMResources' +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Retry" +><A NAME="v%3ARetry" +></A +></A +><B +>Retry</B +></TD +><TD CLASS="rdoc" +>forces a retry +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Resources" +><A NAME="v%3AResources" +></A +></A +><B +>Resources</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:toAdd" +><A NAME="v%3AtoAdd" +></A +></A +><B +>toAdd</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be inserted back in the cache +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toDelete" +><A NAME="v%3AtoDelete" +></A +></A +><B +>toDelete</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be deleted from the cache and from permanent storage +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toReturn" +><A NAME="v%3AtoReturn" +></A +></A +><B +>toReturn</B +> :: b</TD +><TD CLASS="rdoc" +>result to be returned +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:resources" +><A NAME="v%3Aresources" +></A +></A +><B +>resources</B +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>resources= Resources [] [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:setCache" +><A NAME="v%3AsetCache" +></A +></A +><B +>setCache</B +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>set the cache. this is useful for hot loaded modules that will update an existing cache +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:refcache" +><A NAME="v%3Arefcache" +></A +></A +><B +>refcache</B +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defaultCheck" +><A NAME="v%3AdefaultCheck" +></A +></A +><B +>defaultCheck</B +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="doc" +>To drop from the cache all the elems not accesed since half the time between now and the last sync + the default check procedure + :: Integer -- current time in seconds + -> Integer --last access time for a given object + -> Integer --last cache syncronization (with the persisten storage) + -> Bool --return true for all the elems not accesed since +half the time between now and the last sync +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:IDynamic" +><A NAME="t%3AIDynamic" +></A +></A +><B +>IDynamic</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><SPAN CLASS="keyword" +>forall</SPAN +> a . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => <A NAME="v:IDynamic" +><A NAME="v%3AIDynamic" +></A +></A +><B +>IDynamic</B +> a</TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IDynamic')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IDynamic" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Text-Show.html#t%3AShow" +>Show</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:Cache" +><A NAME="t%3ACache" +></A +></A +><B +>Cache</B +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:DynamicInterface" +><A NAME="t%3ADynamicInterface" +></A +></A +><B +>DynamicInterface</B +> x <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>DynamicInterface groups a set of default method calls to handle dynamic objects. It is not necessary to derive instances from it +</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:toIDyn" +><A NAME="v%3AtoIDyn" +></A +></A +><B +>toIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: x</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +>encapsulates data in a dynamic object +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:registerType" +><A NAME="v%3AregisterType" +></A +></A +><B +>registerType</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> x</TD +><TD CLASS="rdoc" +>registers the deserialize, readp and readResource methods for this data type +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:fromIDyn" +><A NAME="v%3AfromIDyn" +></A +></A +><B +>fromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>extract the data from the dynamic object. trows a user error when the cast fails +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:unsafeFromIDyn" +><A NAME="v%3AunsafeFromIDyn" +></A +></A +><B +>unsafeFromIDyn</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> x</TD +><TD CLASS="rdoc" +>unsafe version. +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Key" +><A NAME="t%3AKey" +></A +></A +><B +>Key</B +> </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Key datatype can be used to read any object trough the Dynamic interface. +</P +><PRE +> data Key = Key <TT +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +></TT +> String deriving Typeable</PRE +><P +>Example +</P +><PRE +> mst <- getDResource $ <TT +><A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" +>Key</A +></TT +> type keyofDesiredObject + case mst of + Nothing -> error $ "not found "++ key + Just (idyn) -> fromIDyn idyn :: DesiredDatatype}</PRE +></TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Key" +><A NAME="v%3AKey" +></A +></A +><B +>Key</B +> <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeRep" +>TypeRep</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Key')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:Key" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" +>Key</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTMVars" +><A NAME="v%3AgetTMVars" +></A +></A +><B +>getTMVars</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTMVarsIO" +><A NAME="v%3AgetTMVarsIO" +></A +></A +><B +>getTMVarsIO</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDResource" +><A NAME="v%3AwithDResource" +></A +></A +><B +>withDResource</B +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDResources" +><A NAME="v%3AwithDResources" +></A +></A +><B +>withDResources</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withDSTMResources" +><A NAME="v%3AwithDSTMResources" +></A +></A +><B +>withDSTMResources</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getDResource" +><A NAME="v%3AgetDResource" +></A +></A +><B +>getDResource</B +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getDResources" +><A NAME="v%3AgetDResources" +></A +></A +><B +>getDResources</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteDResource" +><A NAME="v%3AdeleteDResource" +></A +></A +><B +>deleteDResource</B +> :: <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>return error if any resource is not found +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteDResources" +><A NAME="v%3AdeleteDResources" +></A +></A +><B +>deleteDResources</B +> :: [<A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>IDynamic</A +>] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>syncCache</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>clearSyncCacheProc</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResource" +><A NAME="v%3AwithResource" +></A +></A +><B +>withResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> b) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResources" +><A NAME="v%3AwithResources" +></A +></A +><B +>withResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [b]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withSTMResources" +><A NAME="v%3AwithSTMResources" +></A +></A +><B +>withSTMResources</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <SPAN CLASS="keyword" +>forall</SPAN +> x a b . (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b)</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [a]</TD +><TD CLASS="rdoc" +>the list of resources to be retrieved +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Resources</A +> b x</TD +><TD CLASS="rdoc" +>The function that process the resources found and return a Resources structure +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +><TD CLASS="rdoc" +>The return value in the STM monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResource" +><A NAME="v%3AgetResource" +></A +></A +><B +>getResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResources" +><A NAME="v%3AgetResources" +></A +></A +><B +>getResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> b, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> b) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> b]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResource" +><A NAME="v%3AdeleteResource" +></A +></A +><B +>deleteResource</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResources" +><A NAME="v%3AdeleteResources" +></A +></A +><B +>deleteResources</B +> :: (<A HREF="$httptopdir/doc/libraries/base/Data-Typeable.html#t%3ATypeable" +>Typeable</A +> a, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>IResource</A +> a) => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/Data-TCache-TMVar.html view
@@ -0,0 +1,1463 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.TMVar</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache-TMVar.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache.TMVar</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Description</TD +></TR +><TR +><TD CLASS="doc" +>A version of <TT +>Data.TCache</TT +> using <TT +>TMVar</TT +>s instead of <TT +>TVars</TT +>s. See <TT +>Control.Concurrent.TMVar</TT +> +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AIResource" +>IResource</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AkeyResource" +>keyResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aserialize" +>serialize</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adeserialize" +>deserialize</A +> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atshowp" +>tshowp</A +> :: a -> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atreadp" +>treadp</A +> :: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefPath" +>defPath</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadResource" +>readResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteResource" +>writeResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdelResource" +>delResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AResources" +>Resources</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARetry" +>Retry</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AResources" +>Resources</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoAdd" +>toAdd</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoDelete" +>toDelete</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoReturn" +>toReturn</A +> :: b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresources" +>resources</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTMVars" +>getTMVars</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> a)]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTMVarsIO" +>getTMVarsIO</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> a]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithSTMResources" +>withSTMResources</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-TMVar.html#t%3AResources" +>Resources</A +> a x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResources" +>withResources</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [a]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResource" +>withResource</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> a) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResources" +>getResources</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>getResource</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>deleteResources</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>deleteResource</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ACache" +>Cache</A +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetCache" +>setCache</A +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnewCache" +>newCache</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arefcache" +>refcache</A +> :: <A HREF="Data-TCache-TMVar.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>syncCache</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AclearSyncCacheProc" +>clearSyncCacheProc</A +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => <A HREF="Data-TCache-TMVar.html#t%3ACache" +>Cache</A +> a -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> (<A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefaultCheck" +>defaultCheck</A +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:IResource" +><A NAME="t%3AIResource" +></A +></A +><B +>IResource</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Interface that must be defined for every object being cached. + <TT +><A HREF="Data-TCache-TMVar.html#v%3AreadResource" +>readResource</A +></TT +> and <TT +><A HREF="Data-TCache-TMVar.html#v%3AwriteResource" +>writeResource</A +></TT +> are implemented by default as read-write to files with its key as filename + <TT +><A HREF="Data-TCache-TMVar.html#v%3Aserialize" +>serialize</A +></TT +> and <TT +><A HREF="Data-TCache-TMVar.html#v%3Adeserialize" +>deserialize</A +></TT +> are specified just to allow these defaults. If you define your own persistence, then + <TT +>serialize</TT +> and <TT +>deserialize</TT +> are not needed. The package Workflow need them anyway. +</P +><P +>minimal definition: keyResource, serialize, deserialize +</P +><P +>While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and +tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined +by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be +serialized as part of larger structures that embody them. This is necessary for the Workdlow package. +</P +><P +>The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example: +</P +><PRE +>data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s</PRE +><P +>the data being accesed must have the fields used by keyResource filled. For example +</P +><PRE +> readResource Person {name=<A HREF="John.html" +>John</A +>, surname= <A HREF="Adams.html" +>Adams</A +>}</PRE +><P +>leaving the rest of the fields undefined +</P +><P +>IResource has defaults definitions for all the methods except keyResource + Either one or other serializer must be defiened for default witeResource, readResource and delResource +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:keyResource" +><A NAME="v%3AkeyResource" +></A +></A +><B +>keyResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:serialize" +><A NAME="v%3Aserialize" +></A +></A +><B +>serialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deserialize" +><A NAME="v%3Adeserialize" +></A +></A +><B +>deserialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:tshowp" +><A NAME="v%3Atshowp" +></A +></A +><B +>tshowp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>serializer in the RefSerialize monad. Either one or other serializer must be defined to use default persistence +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:treadp" +><A NAME="v%3Atreadp" +></A +></A +><B +>treadp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +><TD CLASS="rdoc" +>deserialize in the RefSerilzlize monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defPath" +><A NAME="v%3AdefPath" +></A +></A +><B +>defPath</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>additional extension for default file paths or key prefixes +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:readResource" +><A NAME="v%3AreadResource" +></A +></A +><B +>readResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:writeResource" +><A NAME="v%3AwriteResource" +></A +></A +><B +>writeResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:delResource" +><A NAME="v%3AdelResource" +></A +></A +><B +>delResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IResource')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IResource" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Resources" +><A NAME="t%3AResources" +></A +></A +><B +>Resources</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Resources returned by withSTMResources' +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Retry" +><A NAME="v%3ARetry" +></A +></A +><B +>Retry</B +></TD +><TD CLASS="rdoc" +>forces a retry +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Resources" +><A NAME="v%3AResources" +></A +></A +><B +>Resources</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:toAdd" +><A NAME="v%3AtoAdd" +></A +></A +><B +>toAdd</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be inserted back in the cache +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toDelete" +><A NAME="v%3AtoDelete" +></A +></A +><B +>toDelete</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be deleted from the cache and from permanent storage +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toReturn" +><A NAME="v%3AtoReturn" +></A +></A +><B +>toReturn</B +> :: b</TD +><TD CLASS="rdoc" +>result to be returned +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:resources" +><A NAME="v%3Aresources" +></A +></A +><B +>resources</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>resources= Resources [] [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTMVars" +><A NAME="v%3AgetTMVars" +></A +></A +><B +>getTMVars</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> a)]</TD +></TR +><TR +><TD CLASS="doc" +>getTMVars return the TMVar that wraps the resources for which the keys are given . + | it return Nothing if a TMVar with this object has not been allocated + These TMVars can be used in explicit user constructed atomic blocks + Additionally, the TMVars remain in the cache and can be accessed and updated by the rest + of the TCache methods. + the content of the TMVars are written every time the cache is syncronized with the storage until releaseTMVars is called +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTMVarsIO" +><A NAME="v%3AgetTMVarsIO" +></A +></A +><B +>getTMVarsIO</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/stm/Control-Concurrent-STM-TMVar.html#t%3ATMVar" +>TMVar</A +> a]</TD +></TR +><TR +><TD CLASS="doc" +>getTMVarsIO does not search for a TMVar in the cache like getTMVars. Instead of this getTMVarsIO creates a list of + TMVars with the content given in the list of resourcees and add these TMVars to the cache and return them. + the content of the TMVars are written every time the cache is syncronized with the storage until releaseTMVars is called +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withSTMResources" +><A NAME="v%3AwithSTMResources" +></A +></A +><B +>withSTMResources</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [a]</TD +><TD CLASS="rdoc" +>the list of resources to be retrieved +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache-TMVar.html#t%3AResources" +>Resources</A +> a x</TD +><TD CLASS="rdoc" +>The function that process the resources found and return a Resources structure +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +><TD CLASS="rdoc" +>The return value in the STM monad. +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>this is the main function for the *Resources primitivas, all the rest derive from it. the Res structure processed by the + with*Resources primitives are more efficient for cached TMVars because the internal loop is never retried, since all the necessary + resources at the beginning so no costly retries are necessary. The advantage increases with the complexity of the process + function passed to withSTMResources is interpreted as such: + -toUpdate secton is used to update the retrieved resources in the same order. + if the resource dont exist, it is created. Nothing means do nothing as usual. extra resources are not considered, + it uses the rules of zip. + -toAdd: additional resources not read in the first parameter of withSTMResources are created/updated with toAdd + -toDelete: obvious + -toReturn: will be returned by the call +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResources" +><A NAME="v%3AwithResources" +></A +></A +><B +>withResources</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [a]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>to atomically add/modify many objects in the cache + :: (IResource a)=> [a] list of resources to be retrieve + -> ([Maybe a]-> [a]) function that process the retrieved resources + -> IO () and return a list of objects to be inserted/modified +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResource" +><A NAME="v%3AwithResource" +></A +></A +><B +>withResource</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> a) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>update of a single object in the cache + :: (IResource a)=> a same as withResources , but for one only object + -> ([Maybe a]-> a) + -> IO () +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResources" +><A NAME="v%3AgetResources" +></A +></A +><B +>getResources</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a]</TD +></TR +><TR +><TD CLASS="doc" +>to read a resource from the cache +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>getResource</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>deleteResources</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>deleteResource</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:Cache" +><A NAME="t%3ACache" +></A +></A +><B +>Cache</B +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:setCache" +><A NAME="v%3AsetCache" +></A +></A +><B +>setCache</B +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>set the cache. this is useful for hot loaded modules that will update an existing cache +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:newCache" +><A NAME="v%3AnewCache" +></A +></A +><B +>newCache</B +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>newCache creates a new cache +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:refcache" +><A NAME="v%3Arefcache" +></A +></A +><B +>refcache</B +> :: <A HREF="Data-TCache-TMVar.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>syncCache</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:clearSyncCacheProc" +><A NAME="v%3AclearSyncCacheProc" +></A +></A +><B +>clearSyncCacheProc</B +> :: <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>IResource</A +> a => <A HREF="Data-TCache-TMVar.html#t%3ACache" +>Cache</A +> a -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> (<A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +></TR +><TR +><TD CLASS="doc" +>start the thread that clean and writes on the persistent storage. + Otherwise, clearSyncCache must be invoked explicitly or no persistence will exist + :: (IResource a) =>Cache a --The cache reference + -> Int --number of seconds betwen checks + -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object +(when this function return True, the object is removed from cache) + -> Int --The max number of objects in the cache, if more, the cleanup start + -> >IO ThreadId --Identifier of the thread created +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defaultCheck" +><A NAME="v%3AdefaultCheck" +></A +></A +><B +>defaultCheck</B +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="doc" +>To drop from the cache all the elems not accesed since half the time between now and the last sync + the default check procedure + :: Integer -- current time in seconds + -> Integer --last access time for a given object + -> Integer --last cache syncronization (with the persisten storage) + -> Bool --return true for all the elems not accesed since +half the time between now and the last sync +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/Data-TCache.html view
@@ -0,0 +1,1803 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +><SCRIPT TYPE="text/javascript" +>window.onload = function () {setSynopsis("mini_Data-TCache.html")};</SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="modulebar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><FONT SIZE="6" +>Data.TCache</FONT +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Synopsis</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="#t%3AIResource" +>IResource</A +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="#v%3AkeyResource" +>keyResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aserialize" +>serialize</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Adeserialize" +>deserialize</A +> :: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +> -> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atshowp" +>tshowp</A +> :: a -> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Atreadp" +>treadp</A +> :: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefPath" +>defPath</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreadResource" +>readResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwriteResource" +>writeResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdelResource" +>delResource</A +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="#t%3AResources" +>Resources</A +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +>= <A HREF="#v%3ARetry" +>Retry</A +></TD +></TR +><TR +><TD CLASS="decl" +>| <A HREF="#v%3AResources" +>Resources</A +> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoAdd" +>toAdd</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoDelete" +>toDelete</A +> :: [a]</TD +></TR +><TR +><TD CLASS="recfield" +><A HREF="#v%3AtoReturn" +>toReturn</A +> :: b</TD +></TR +></TABLE +>}</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Aresources" +>resources</A +> :: <A HREF="Data-TCache.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTVars" +>getTVars</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> a)]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AreleaseTVars" +>releaseTVars</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetTVarsIO" +>getTVarsIO</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> a]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithSTMResources" +>withSTMResources</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache.html#t%3AResources" +>Resources</A +> a x) -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResources" +>withResources</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [a]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AwithResource" +>withResource</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => a -> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> a) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResources" +>getResources</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a]</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AgetResource" +>getResource</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResources" +>deleteResources</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdeleteResource" +>deleteResource</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="#t%3ACache" +>Cache</A +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsetCache" +>setCache</A +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AnewCache" +>newCache</A +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3Arefcache" +>refcache</A +> :: <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AsyncCache" +>syncCache</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AclearSyncCacheProc" +>clearSyncCacheProc</A +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> (<A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +>) -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +> -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="#v%3AdefaultCheck" +>defaultCheck</A +> :: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="section1" +>Documentation</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A NAME="t:IResource" +><A NAME="t%3AIResource" +></A +></A +><B +>IResource</B +> a <SPAN CLASS="keyword" +>where</SPAN +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +><P +>Interface that must be defined for every object being cached. + <TT +><A HREF="Data-TCache.html#v%3AreadResource" +>readResource</A +></TT +> and <TT +><A HREF="Data-TCache.html#v%3AwriteResource" +>writeResource</A +></TT +> are implemented by default as read-write to files with its key as filename + <TT +><A HREF="Data-TCache.html#v%3Aserialize" +>serialize</A +></TT +> and <TT +><A HREF="Data-TCache.html#v%3Adeserialize" +>deserialize</A +></TT +> are specified just to allow these defaults. If you define your own persistence, then + <TT +>serialize</TT +> and <TT +>deserialize</TT +> are not needed. The package Workflow need them anyway. +</P +><P +>minimal definition: keyResource, serialize, deserialize +</P +><P +>While serialize and deserialize are agnostic about the way of converison to strings, either binary or textual, treadp and +tshowp use the monad defined in the RefSerialize package. Both ways of serialization are alternative. one is defined +by default in terms of the other. the RefSerialize monad has been introduced to permit IResource objects to be +serialized as part of larger structures that embody them. This is necessary for the Workdlow package. +</P +><P +>The keyResource string must be a unique since this is used to index it in the hash table. +when accessing a resource, the user must provide a partial object for wich the key can be obtained. +for example: +</P +><PRE +>data Person= Person{name, surname:: String, account :: Int ....) + +keyResource Person n s ...= n++s</PRE +><P +>the data being accesed must have the fields used by keyResource filled. For example +</P +><PRE +> readResource Person {name=<A HREF="John.html" +>John</A +>, surname= <A HREF="Adams.html" +>Adams</A +>}</PRE +><P +>leaving the rest of the fields undefined +</P +><P +>IResource has defaults definitions for all the methods except keyResource + Either one or other serializer must be defiened for default witeResource, readResource and delResource +</P +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +>Methods</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A NAME="v:keyResource" +><A NAME="v%3AkeyResource" +></A +></A +><B +>keyResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:serialize" +><A NAME="v%3Aserialize" +></A +></A +><B +>serialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deserialize" +><A NAME="v%3Adeserialize" +></A +></A +><B +>deserialize</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> a</TD +><TD CLASS="rdoc" +>must be defined by the user +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:tshowp" +><A NAME="v%3Atshowp" +></A +></A +><B +>tshowp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>serializer in the RefSerialize monad. Either one or other serializer must be defined to use default persistence +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:treadp" +><A NAME="v%3Atreadp" +></A +></A +><B +>treadp</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="C:\Archivos de programa\Haskell\doc\RefSerialize-0.2.4\html/Data-Parser.html#t%3AST" +>ST</A +> a</TD +><TD CLASS="rdoc" +>deserialize in the RefSerilzlize monad. +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defPath" +><A NAME="v%3AdefPath" +></A +></A +><B +>defPath</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Char.html#t%3AString" +>String</A +></TD +><TD CLASS="rdoc" +>additional extension for default file paths or key prefixes +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:readResource" +><A NAME="v%3AreadResource" +></A +></A +><B +>readResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:writeResource" +><A NAME="v%3AwriteResource" +></A +></A +><B +>writeResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:delResource" +><A NAME="v%3AdelResource" +></A +></A +><B +>delResource</B +> :: a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s8" +></TD +></TR +><TR +><TD CLASS="section4" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:IResource')" ALT="show/hide" +> Instances</TD +></TR +><TR +><TD CLASS="body" +><DIV ID="i:IResource" STYLE="display:block;" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="decl" +><A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Key</A +></TD +></TR +><TR +><TD CLASS="decl" +><A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>IDynamic</A +></TD +></TR +></TABLE +></DIV +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A NAME="t:Resources" +><A NAME="t%3AResources" +></A +></A +><B +>Resources</B +> a b </TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="ndoc" +>Resources returned by withSTMResources' +</TD +></TR +><TR +><TD CLASS="section4" +>Constructors</TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:Retry" +><A NAME="v%3ARetry" +></A +></A +><B +>Retry</B +></TD +><TD CLASS="rdoc" +>forces a retry +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:Resources" +><A NAME="v%3AResources" +></A +></A +><B +>Resources</B +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="body" COLSPAN="2" +><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" +><TR +><TD CLASS="arg" +><A NAME="v:toAdd" +><A NAME="v%3AtoAdd" +></A +></A +><B +>toAdd</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be inserted back in the cache +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toDelete" +><A NAME="v%3AtoDelete" +></A +></A +><B +>toDelete</B +> :: [a]</TD +><TD CLASS="rdoc" +>resources to be deleted from the cache and from permanent storage +</TD +></TR +><TR +><TD CLASS="arg" +><A NAME="v:toReturn" +><A NAME="v%3AtoReturn" +></A +></A +><B +>toReturn</B +> :: b</TD +><TD CLASS="rdoc" +>result to be returned +</TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:resources" +><A NAME="v%3Aresources" +></A +></A +><B +>resources</B +> :: <A HREF="Data-TCache.html#t%3AResources" +>Resources</A +> a <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><PRE +>resources= Resources [] [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTVars" +><A NAME="v%3AgetTVars" +></A +></A +><B +>getTVars</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [a]</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> (<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> a)]</TD +><TD CLASS="rdoc" +>The TVars that contain such objects +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>getTVars return the TVar that wraps the resources for which the keys are given . + | it return <TT +>Nothing</TT +> if a TVar with this object has not been allocated + These TVars can be used as usual in explicit user constructed atomic blocks + Additionally, the retrieved TVars remain in the cache and can be accessed and updated by the rest + of the TCache methods. + to keep the consistence in the serialized data, the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:releaseTVars" +><A NAME="v%3AreleaseTVars" +></A +></A +><B +>releaseTVars</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>releaseTVars permits the TVars captured by getTVars to be released. so they can be discarded when not used. + Do this when you no longer need to use them directly in atomic blocks. +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getTVarsIO" +><A NAME="v%3AgetTVarsIO" +></A +></A +><B +>getTVarsIO</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ATVar" +>TVar</A +> a]</TD +></TR +><TR +><TD CLASS="doc" +>getTVarsIO does not search for a TVar in the cache like getTVars. Instead of this getTVarsIO creates a list of + TVars with the content given in the list of resourcees and add these TVars to the cache and return them. + the content of the TVars are written every time the cache is syncronized with the storage until releaseTVars is called +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withSTMResources" +><A NAME="v%3AwithSTMResources" +></A +></A +><B +>withSTMResources</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> [a]</TD +><TD CLASS="rdoc" +>the list of resources to be retrieved +</TD +></TR +><TR +><TD CLASS="arg" +>-> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> <A HREF="Data-TCache.html#t%3AResources" +>Resources</A +> a x</TD +><TD CLASS="rdoc" +>The function that process the resources found and return a Resources structure +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/GHC-Conc.html#t%3ASTM" +>STM</A +> x</TD +><TD CLASS="rdoc" +>The return value in the STM monad. +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>this is the main function for the *Resource calls. All the rest derive from it. The results are kept in the STM monad + so it can be part of a larger STM transaction involving other TVars + The <TT +><A HREF="Data-TCache.html#t%3AResources" +>Resources</A +></TT +> register returned by the user-defined function is interpreted as such: +</P +><P +><TT +><A HREF="Data-TCache.html#v%3AtoAdd" +>toAdd</A +></TT +>: additional resources not read in the first parameter of withSTMResources are created/updated with toAdd +</P +><P +><TT +><A HREF="Data-TCache.html#v%3AtoDelete" +>toDelete</A +></TT +>: from the cache and from permanent storage +</P +><P +><TT +><A HREF="Data-TCache.html#v%3AtoReturn" +>toReturn</A +></TT +>: will be returned by withSTMResources +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResources" +><A NAME="v%3AwithResources" +></A +></A +><B +>withResources</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> ([<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a] -> [a]) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>to atomically add/modify many objects in the cache +</P +><PRE +> withResources rs f= atomically $ withSTMResources rs f1 >> return() where f1 mrs= let as= f mrs in Resources as [] ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:withResource" +><A NAME="v%3AwithResource" +></A +></A +><B +>withResource</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> a</TD +><TD CLASS="rdoc" +>prototypes of the object to be retrieved for which keyResource can be derived +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a -> a</TD +><TD CLASS="rdoc" +>update function that return another full object +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>update of a single object in the cache +</P +><PRE +>withResource r f= withResources [r] ([mr]-> [f mr])</PRE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResources" +><A NAME="v%3AgetResources" +></A +></A +><B +>getResources</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> [<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a]</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:getResource" +><A NAME="v%3AgetResource" +></A +></A +><B +>getResource</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (<A HREF="$httptopdir/doc/libraries/base/Data-Maybe.html#t%3AMaybe" +>Maybe</A +> a)</TD +></TR +><TR +><TD CLASS="doc" +><P +>to read a resource from the cache. +</P +><PRE +>getResource r= do{mr<- getResources [r];return $! head mr}</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResources" +><A NAME="v%3AdeleteResources" +></A +></A +><B +>deleteResources</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => [a] -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>delete the list of resources from cache and from persistent storage. +</P +><PRE +> deleteResources rs= atomically $ withSTMResources rs f1 where f1 mrs = Resources [] (catMaybes mrs) ()</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:deleteResource" +><A NAME="v%3AdeleteResource" +></A +></A +><B +>deleteResource</B +> :: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a => a -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +><P +>delete the resource from cache and from persistent storage. +</P +><PRE +> deleteResource r= deleteResources [r]</PRE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A NAME="t:Cache" +><A NAME="t%3ACache" +></A +></A +><B +>Cache</B +> a = <A HREF="$httptopdir/doc/libraries/base/Data-IORef.html#t%3AIORef" +>IORef</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:setCache" +><A NAME="v%3AsetCache" +></A +></A +><B +>setCache</B +> :: (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>) -> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +></TR +><TR +><TD CLASS="doc" +>set the cache. this is useful for hot loaded modules that will update an existing cache. Experimental +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:newCache" +><A NAME="v%3AnewCache" +></A +></A +><B +>newCache</B +> :: <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> (Ht a, <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +>)</TD +></TR +><TR +><TD CLASS="doc" +>newCache creates a new cache. Experimental +</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:refcache" +><A NAME="v%3Arefcache" +></A +></A +><B +>refcache</B +> :: <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:syncCache" +><A NAME="v%3AsyncCache" +></A +></A +><B +>syncCache</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a</TD +><TD CLASS="rdoc" +>the cache reference ( <TT +><A HREF="Data-TCache.html#v%3Arefcache" +>refcache</A +></TT +> usually) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Unit.html#t%3A%28%29" +>()</A +></TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>Force the atomic write of all the cached objects into permanent storage + useful for termination +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:clearSyncCacheProc" +><A NAME="v%3AclearSyncCacheProc" +></A +></A +><B +>clearSyncCacheProc</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="Data-TCache.html#t%3AIResource" +>IResource</A +> a</TD +><TD CLASS="rdoc" +></TD +></TR +><TR +><TD CLASS="arg" +>=> <A HREF="Data-TCache.html#t%3ACache" +>Cache</A +> a</TD +><TD CLASS="rdoc" +>The cache reference (<TT +><A HREF="Data-TCache.html#v%3Arefcache" +>refcache</A +></TT +> usually) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>number of seconds betwen checks. objects not written to disk are written +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +> -> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +><TD CLASS="rdoc" +>The user-defined check-for-cleanup-from-cache for each object. <TT +><A HREF="Data-TCache.html#v%3AdefaultCheck" +>defaultCheck</A +></TT +> is an example +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Types.html#t%3AInt" +>Int</A +></TD +><TD CLASS="rdoc" +>The max number of objects in the cache, if more, the cleanup starts +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/base/System-IO.html#t%3AIO" +>IO</A +> <A HREF="$httptopdir/doc/libraries/base/Control-Concurrent.html#t%3AThreadId" +>ThreadId</A +></TD +><TD CLASS="rdoc" +>Identifier of the thread created +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +><P +>Cache handling +</P +><P +>Start the thread that clean and writes on the persistent storage. + Otherwise, clearSyncCache must be invoked explicitly or no persistence will exist + :: (IResource a) =>Cache a + -> Int --number of seconds betwen checks + -> (Integer-> Integer-> Bool) --The user-defined check-for-cleanup-from-cache for each object +(when this function return True, the object is removed from cache) + -> Int --The max number of objects in the cache, if more, the cleanup start + -> >IO ThreadId --Identifier of the thread created +</P +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +><A NAME="v:defaultCheck" +><A NAME="v%3AdefaultCheck" +></A +></A +><B +>defaultCheck</B +></TD +></TR +><TR +><TD CLASS="body" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="arg" +>:: <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>current time in seconds +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>last access time for a given object +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/integer/GHC-Integer.html#t%3AInteger" +>Integer</A +></TD +><TD CLASS="rdoc" +>last cache syncronization (with the persisten storage) +</TD +></TR +><TR +><TD CLASS="arg" +>-> <A HREF="$httptopdir/doc/libraries/ghc-prim/GHC-Bool.html#t%3ABool" +>Bool</A +></TD +><TD CLASS="rdoc" +>return true for all the elems not accesed since half the time between now and the last sync +</TD +></TR +><TR +><TD CLASS="ndoc" COLSPAN="2" +>To drop from the cache all the elems not accesed since half the time between now and the last sync + ths is a default cache clearance procedure -- it is invoke when the cache size exceeds the defined in <TT +><A HREF="Data-TCache.html#v%3AclearSyncCacheProc" +>clearSyncCacheProc</A +></TT +> +</TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="decl" +>readFileStrict</TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/TCache.haddock view
binary file changed (absent → 54791 bytes)
+ dist/doc/html/TCache/doc-index.html view
@@ -0,0 +1,1166 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TCache-0.6.4: A Transactional data cache with configurable persistence (Index)</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD COLSPAN="2" STYLE="padding-top:5px;" +><FORM onsubmit="full_search(); return false;" ACTION="" +>Search: <INPUT ID="searchbox" onkeyup="quick_search()" +> <INPUT VALUE="Search" TYPE="submit" +> <SPAN ID="searchmsg" +> </SPAN +></FORM +></TD +></TR +><TR +><TD +><TABLE ID="indexlist" CELLPADDING="0" CELLSPACING="5" +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>AccessTime</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#t%3AAccessTime" +>Data.TCache.IResource</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>Cache</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#t%3ACache" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ACache" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#t%3ACache" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#t%3ACache" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>clearSyncCacheProc</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AclearSyncCacheProc" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar.Dynamic</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AclearSyncCacheProc" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AclearSyncCacheProc" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>defaultCheck</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AdefaultCheck" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdefaultCheck" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AdefaultCheck" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AdefaultCheck" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>defPath</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AdefPath" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AdefPath" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdefPath" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AdefPath" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AdefPath" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>deleteDResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteDResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteDResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>deleteDResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteDResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteDResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>deleteResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AdeleteResource" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>deleteResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AdeleteResources" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>delResource</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AdelResource" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AdelResource" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdelResource" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AdelResource" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AdelResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>deserialize</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3Adeserialize" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3Adeserialize" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Adeserialize" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3Adeserialize" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Adeserialize" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>DynamicInterface</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#t%3ADynamicInterface" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ADynamicInterface" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#t%3ADynamicInterface" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>fromIDyn</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AfromIDyn" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AfromIDyn" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AfromIDyn" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getDResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetDResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetDResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getDResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetDResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetDResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AgetResource" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AgetResources" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AgetResources" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getTMVars</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AgetTMVars" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetTMVars" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getTMVarsIO</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AgetTMVarsIO" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetTMVarsIO" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getTVars</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AgetTVars" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetTVars" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>getTVarsIO</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AgetTVarsIO" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AgetTVarsIO" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>hash</TD +><TD CLASS="indexlinks" +>Data.TCache.IDynamic</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>IDynamic</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AIDynamic" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AIDynamic" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AIDynamic" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>infinite</TD +><TD CLASS="indexlinks" +>Data.TCache.IResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>IResource</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#t%3AIResource" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#t%3AIResource" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#t%3AIResource" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#t%3AIResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>Key</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#t%3AKey" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#t%3AKey" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AKey" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AKey" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AKey" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>keyResource</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AkeyResource" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AkeyResource" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AkeyResource" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AkeyResource" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AkeyResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>list</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3Alist" +>Data.TCache.IDynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>ModifTime</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#t%3AModifTime" +>Data.TCache.IResource</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>newCache</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AnewCache" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AnewCache" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>readFileStrict</TD +><TD CLASS="indexlinks" +>Data.TCache.IResource, Data.TCache.TMVar, Data.TCache.TMVar.Dynamic, Data.TCache, Data.TCache.Dynamic</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>readResource</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AreadResource" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AreadResource" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AreadResource" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AreadResource" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AreadResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>refcache</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3Arefcache" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Arefcache" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3Arefcache" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Arefcache" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>registerType</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AregisterType" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AregisterType" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AregisterType" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>releaseTVars</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AreleaseTVars" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AreleaseTVars" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>Resources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Type/Class)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#t%3AResources" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#t%3AResources" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#t%3AResources" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#t%3AResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Data Constructor)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AResources" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AResources" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AResources" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AResources" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>resources</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3Aresources" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3Aresources" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Aresources" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3Aresources" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Aresources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>Retry</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3ARetry" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3ARetry" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3ARetry" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3ARetry" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3ARetry" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>safeFromIDyn</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AsafeFromIDyn" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AsafeFromIDyn" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>serialize</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3Aserialize" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3Aserialize" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Aserialize" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3Aserialize" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Aserialize" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>setCache</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AsetCache" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AsetCache" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AsetCache" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AsetCache" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>syncCache</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +>Data.TCache.TMVar.Dynamic</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AsyncCache" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AsyncCache" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>toAdd</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AtoAdd" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AtoAdd" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AtoAdd" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AtoAdd" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AtoAdd" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>toDelete</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AtoDelete" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AtoDelete" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AtoDelete" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AtoDelete" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AtoDelete" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>toIDyn</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AtoIDyn" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AtoIDyn" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AtoIDyn" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>toReturn</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AtoReturn" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AtoReturn" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AtoReturn" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AtoReturn" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AtoReturn" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>treadp</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3Atreadp" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3Atreadp" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Atreadp" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3Atreadp" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Atreadp" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>tshowp</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3Atshowp" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3Atshowp" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3Atshowp" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3Atshowp" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3Atshowp" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>unsafeFromIDyn</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IDynamic.html#v%3AunsafeFromIDyn" +>Data.TCache.IDynamic</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AunsafeFromIDyn" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AunsafeFromIDyn" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withDResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withDResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withDSTMResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDSTMResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDSTMResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withResource</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AwithResource" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithResource" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AwithResource" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithResource" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AwithResources" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AwithResources" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" COLSPAN="2" +>withSTMResources</TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>1 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar.html#v%3AwithSTMResources" +>Data.TCache.TMVar</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>2 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithSTMResources" +>Data.TCache.TMVar.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>3 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache.html#v%3AwithSTMResources" +>Data.TCache</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexannot" +>4 (Function)</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-Dynamic.html#v%3AwithSTMResources" +>Data.TCache.Dynamic</A +></TD +></TR +><TR CLASS="indexrow" +><TD CLASS="indexentry" +>writeResource</TD +><TD CLASS="indexlinks" +><A HREF="Data-TCache-IResource.html#v%3AwriteResource" +>Data.TCache.IResource</A +>, <A HREF="Data-TCache-TMVar.html#v%3AwriteResource" +>Data.TCache.TMVar</A +>, <A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwriteResource" +>Data.TCache.TMVar.Dynamic</A +>, <A HREF="Data-TCache.html#v%3AwriteResource" +>Data.TCache</A +>, <A HREF="Data-TCache-Dynamic.html#v%3AwriteResource" +>Data.TCache.Dynamic</A +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/frames.html view
@@ -0,0 +1,27 @@+<html> +<head> +<script type="text/javascript"><!-- +/* + + The synopsis frame needs to be updated using javascript, so we hide + it by default and only show it if javascript is enabled. + + TODO: provide some means to disable it. +*/ +function load() { + var d = document.getElementById("inner-fs"); + d.rows = "50%,50%"; +} +--></script> +<frameset id="outer-fs" cols="25%,75%" onload="load()"> + <frameset id="inner-fs" rows="100%,0%"> + + <frame src="index-frames.html" name="modules"> + <frame src="" name="synopsis"> + + </frameset> + <frame src="index.html" name="main"> + +</frameset> + +</html>
+ dist/doc/html/TCache/haddock-util.js view
@@ -0,0 +1,139 @@+// Haddock JavaScript utilities +function toggle(button,id) +{ + var n = document.getElementById(id).style; + if (n.display == "none") + { + button.src = "minus.gif"; + n.display = "block"; + } + else + { + button.src = "plus.gif"; + n.display = "none"; + } +} + + +var max_results = 75; // 50 is not enough to search for map in the base libraries +var shown_range = null; +var last_search = null; + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + if (text == last_search && !full) return; + last_search = text; + + var table = document.getElementById("indexlist"); + var status = document.getElementById("searchmsg"); + var children = table.firstChild.childNodes; + + // first figure out the first node with the prefix + var first = bisect(-1); + var last = (first == -1 ? -1 : bisect(1)); + + if (first == -1) + { + table.className = ""; + status.innerHTML = "No results found, displaying all"; + } + else if (first == 0 && last == children.length - 1) + { + table.className = ""; + status.innerHTML = ""; + } + else if (last - first >= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} + +function setSynopsis(filename) { + if (parent.window.synopsis) { + parent.window.synopsis.location = filename; + } +}
+ dist/doc/html/TCache/haddock.css view
@@ -0,0 +1,297 @@+/* -------- Global things --------- */ + +BODY { + background-color: #ffffff; + color: #000000; + font-family: sans-serif; + padding: 0 0; + } + +A:link { color: #0000e0; text-decoration: none } +A:visited { color: #0000a0; text-decoration: none } +A:hover { background-color: #e0e0ff; text-decoration: none } + +TABLE.vanilla { + width: 100%; + border-width: 0px; + /* I can't seem to specify cellspacing or cellpadding properly using CSS... */ +} + +TABLE.vanilla2 { + border-width: 0px; +} + +/* <TT> font is a little too small in MSIE */ +TT { font-size: 100%; } +PRE { font-size: 100%; } + +LI P { margin: 0pt } + +TD { + border-width: 0px; +} + +TABLE.narrow { + border-width: 0px; +} + +TD.s8 { height: 8px; } +TD.s15 { height: 15px; } + +SPAN.keyword { text-decoration: underline; } + +/* Resize the buttom image to match the text size */ +IMG.coll { width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em } + +/* --------- Contents page ---------- */ + +DIV.node { + padding-left: 3em; +} + +DIV.cnode { + padding-left: 1.75em; +} + +SPAN.pkg { + position: absolute; + left: 50em; +} + +/* --------- Documentation elements ---------- */ + +TD.children { + padding-left: 25px; + } + +TD.synopsis { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace + } + +TD.decl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + } + +TD.topdecl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; +} + +TABLE.declbar { + border-spacing: 0px; + } + +TD.declname { + width: 100%; + } + +TD.declbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #000099; + border-left-style: solid; + white-space: nowrap; + font-size: small; + } + +/* + arg is just like decl, except that wrapping is not allowed. It is + used for function and constructor arguments which have a text box + to the right, where if wrapping is allowed the text box squashes up + the declaration by wrapping it. +*/ +TD.arg { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + white-space: nowrap; + } + +TD.recfield { padding-left: 20px } + +TD.doc { + padding-top: 2px; + padding-left: 10px; + } + +TD.ndoc { + padding: 2px; + } + +TD.rdoc { + padding: 2px; + padding-left: 10px; + width: 100%; + } + +TD.body { + padding-left: 10px + } + +TD.pkg { + width: 100%; + padding-left: 10px +} + +TABLE.indexsearch TR.indexrow { + display: none; +} +TABLE.indexsearch TR.indexshow { + display: table-row; +} + +TD.indexentry { + vertical-align: top; + padding-right: 10px + } + +TD.indexannot { + vertical-align: top; + padding-left: 20px; + white-space: nowrap + } + +TD.indexlinks { + width: 100% + } + +/* ------- Section Headings ------- */ + +TD.section1 { + padding-top: 15px; + font-weight: bold; + font-size: 150% + } + +TD.section2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +TD.section3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +TD.section4 { + font-weight: bold; + font-size: 100% + } + +/* -------------- The title bar at the top of the page */ + +TD.infohead { + color: #ffffff; + font-weight: bold; + padding-right: 10px; + text-align: left; +} + +TD.infoval { + color: #ffffff; + padding-right: 10px; + text-align: left; +} + +TD.topbar { + background-color: #000099; + padding: 5px; +} + +TD.title { + color: #ffffff; + padding-left: 10px; + width: 100% + } + +TD.topbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + } + +TD.topbut A:link { + color: #ffffff + } + +TD.topbut A:visited { + color: #ffff00 + } + +TD.topbut A:hover { + background-color: #6060ff; + } + +TD.topbut:hover { + background-color: #6060ff + } + +TD.modulebar { + background-color: #0077dd; + padding: 5px; + border-top-width: 1px; + border-top-color: #ffffff; + border-top-style: solid; + } + +/* --------- The page footer --------- */ + +TD.botbar { + background-color: #000099; + color: #ffffff; + padding: 5px + } +TD.botbar A:link { + color: #ffffff; + text-decoration: underline + } +TD.botbar A:visited { + color: #ffff00 + } +TD.botbar A:hover { + background-color: #6060ff + } + +/* --------- Mini Synopsis for Frame View --------- */ + +.outer { + margin: 0 0; + padding: 0 0; +} + +.mini-synopsis { + padding: 0.25em 0.25em; +} + +.mini-synopsis H1 { font-size: 130%; } +.mini-synopsis H2 { font-size: 110%; } +.mini-synopsis H3 { font-size: 100%; } +.mini-synopsis H1, .mini-synopsis H2, .mini-synopsis H3 { + margin-top: 0.5em; + margin-bottom: 0.25em; + padding: 0 0; +} + +.mini-synopsis H1 { border-bottom: 1px solid #ccc; } + +.mini-topbar { + font-size: 130%; + background: #0077dd; + padding: 0.25em; +} + +
+ dist/doc/html/TCache/haskell_icon.gif view
binary file changed (absent → 911 bytes)
+ dist/doc/html/TCache/index-frames.html view
@@ -0,0 +1,37 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TCache-0.6.4: A Transactional data cache with configurable persistence</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><P +><A HREF="Data-TCache.html" TARGET="main" +>Data.TCache</A +><BR +><A HREF="Data-TCache-Dynamic.html" TARGET="main" +>Data.TCache.Dynamic</A +><BR +><A HREF="Data-TCache-IDynamic.html" TARGET="main" +>Data.TCache.IDynamic</A +><BR +><A HREF="Data-TCache-IResource.html" TARGET="main" +>Data.TCache.IResource</A +><BR +><A HREF="Data-TCache-TMVar.html" TARGET="main" +>Data.TCache.TMVar</A +><BR +><A HREF="Data-TCache-TMVar-Dynamic.html" TARGET="main" +>Data.TCache.TMVar.Dynamic</A +><BR +></P +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/index.html view
@@ -0,0 +1,211 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>TCache-0.6.4: A Transactional data cache with configurable persistence</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD CLASS="topbar" +><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" +><TR +><TD +><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " +></TD +><TD CLASS="title" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +><TD CLASS="topbut" +><A HREF="index.html" +>Contents</A +></TD +><TD CLASS="topbut" +><A HREF="doc-index.html" +>Index</A +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="section1" +>TCache-0.6.4: A Transactional data cache with configurable persistence</TD +></TR +><TR +><TD CLASS="doc" +><P +>Data.Tcache is a transactional cache with configurable persistence. It tries to simulate Hibernate +for Java or Rails for Ruby. The main difference is that transactions are done in memory trough STM. +There are transactional cache implementations for some J2EE servers like JBOSS. +</P +><P +>TCache uses STM. It can atomically apply a function to a list of cached objects. The resulting +objects go back to the cache (withResources). It also can retrieve these objects (getResources). +Persistence can be syncronous (syncCache) or asyncronous, wtih configurable time between cache +writes and configurable cache clearance strategy. the size of the cache can be configured too . +All of this can be done trough clearSyncCacheProc. Even the TVar variables can be accessed +directly (getTVar) to acceess all the semantic of atomic blocks while maintaining the persistence of the +TVar updates. +</P +><P +>Persistence can be defined for each object: Each object must have a defined key, a default filename +path (if applicable). Persistence is pre-defined in files, but the readResource writeResource and +delResource methods can be redefined to persist in databases or whatever. +</P +><P +>Serialization is also configurable. +</P +><P +>There are Samples here that explain the main features. +</P +><P +>In this release +</P +><UL +><LI +> added withSTMResources. Most of the rest of the methods are derived from withSTMResources . the results are returned in the STM monad, so this method can be part of al larger STM transaction +It also can perforn used defined retries. +</LI +><LI +> added modules for cached TMVars +Data.TCache.TMVar and Data.TCache.TMVar.Dynamic uses TMVars instead of TVars (See Control.Concurrent.STM.TMVar) +</LI +></UL +><P +>It is not possible tu mix TVars and TMVars packages in the same executable. However code that uses dynamic and non dynamic can +can be mixed +</P +><UL +><LI +> Data.TCache - cached TVars of object of type a. +</LI +><LI +> Data.TCache.Dynamic - cached TVars of objects of type IDynamic. +</LI +><LI +> Data.TCache.TMVar - cached TMVars of objects of type a. +</LI +><LI +> Data.TCache..TMVar.Dynamic - cached TMVars of objects of type IDynamic. +</LI +></UL +></TD +></TR +><TR +><TD CLASS="section1" +>Modules</TD +></TR +><TR +><TD +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" +><TR +><TD STYLE="width: 50em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:0')" ALT="show/hide" +>Data</TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:0" STYLE="display:block;" +><TR +><TD STYLE="width: 48em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:1')" ALT="show/hide" +><A HREF="Data-TCache.html" +>Data.TCache</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:1" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Data-TCache-Dynamic.html" +>Data.TCache.Dynamic</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Data-TCache-IDynamic.html" +>Data.TCache.IDynamic</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding-left: 1.25em;width: 46em" +><A HREF="Data-TCache-IResource.html" +>Data.TCache.IResource</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="width: 46em" +><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'n:2')" ALT="show/hide" +><A HREF="Data-TCache-TMVar.html" +>Data.TCache.TMVar</A +></TD +><TD +></TD +><TD +></TD +></TR +><TR +><TD STYLE="padding: 0; padding-left: 2em" COLSPAN="3" +><TABLE CLASS="vanilla2" CELLSPACING="0" CELLPADDING="0" ID="n:2" STYLE="display:block;" +><TR +><TD STYLE="padding-left: 1.25em;width: 44em" +><A HREF="Data-TCache-TMVar-Dynamic.html" +>Data.TCache.TMVar.Dynamic</A +></TD +><TD +></TD +><TD +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +></TABLE +></TD +></TR +><TR +><TD CLASS="s15" +></TD +></TR +><TR +><TD CLASS="botbar" +>Produced by <A HREF="http://www.haskell.org/haddock/" +>Haddock</A +> version 2.4.2</TD +></TR +></TABLE +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache-Dynamic.html view
@@ -0,0 +1,149 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.Dynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache.Dynamic</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3AIResource" TARGET="main" +>IResource</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3AResources" TARGET="main" +>Resources</A +> a b</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3Aresources" TARGET="main" +>resources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AsetCache" TARGET="main" +>setCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3Arefcache" TARGET="main" +>refcache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AdefaultCheck" TARGET="main" +>defaultCheck</A +></DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3AIDynamic" TARGET="main" +>IDynamic</A +> </DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3ACache" TARGET="main" +>Cache</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3ADynamicInterface" TARGET="main" +>DynamicInterface</A +> x</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-Dynamic.html#t%3AKey" TARGET="main" +>Key</A +> </DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetTVars" TARGET="main" +>getTVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AreleaseTVars" TARGET="main" +>releaseTVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetTVarsIO" TARGET="main" +>getTVarsIO</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDResource" TARGET="main" +>withDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDResources" TARGET="main" +>withDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithDSTMResources" TARGET="main" +>withDSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetDResource" TARGET="main" +>getDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetDResources" TARGET="main" +>getDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteDResource" TARGET="main" +>deleteDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteDResources" TARGET="main" +>deleteDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AsyncCache" TARGET="main" +>syncCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AclearSyncCacheProc" TARGET="main" +>clearSyncCacheProc</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithResource" TARGET="main" +>withResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithResources" TARGET="main" +>withResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AwithSTMResources" TARGET="main" +>withSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetResource" TARGET="main" +>getResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AgetResources" TARGET="main" +>getResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteResource" TARGET="main" +>deleteResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-Dynamic.html#v%3AdeleteResources" TARGET="main" +>deleteResources</A +></DIV +></DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache-IDynamic.html view
@@ -0,0 +1,43 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.IDynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache.IDynamic</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-IDynamic.html#t%3AIDynamic" TARGET="main" +>IDynamic</A +> </DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-IDynamic.html#v%3Alist" TARGET="main" +>list</A +></DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-IDynamic.html#t%3ADynamicInterface" TARGET="main" +>DynamicInterface</A +> x</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-IDynamic.html#t%3AKey" TARGET="main" +>Key</A +> </DIV +></DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache-IResource.html view
@@ -0,0 +1,49 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.IResource</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache.IResource</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-IResource.html#t%3AIResource" TARGET="main" +>IResource</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache-IResource.html#t%3AAccessTime" TARGET="main" +>AccessTime</A +> </DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache-IResource.html#t%3AModifTime" TARGET="main" +>ModifTime</A +> </DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-IResource.html#t%3AResources" TARGET="main" +>Resources</A +> a b</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-IResource.html#v%3Aresources" TARGET="main" +>resources</A +></DIV +></DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache-TMVar-Dynamic.html view
@@ -0,0 +1,137 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.TMVar.Dynamic</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache.TMVar.Dynamic</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIResource" TARGET="main" +>IResource</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AResources" TARGET="main" +>Resources</A +> a b</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3Aresources" TARGET="main" +>resources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AsetCache" TARGET="main" +>setCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3Arefcache" TARGET="main" +>refcache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdefaultCheck" TARGET="main" +>defaultCheck</A +></DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AIDynamic" TARGET="main" +>IDynamic</A +> </DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ACache" TARGET="main" +>Cache</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3ADynamicInterface" TARGET="main" +>DynamicInterface</A +> x</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-TMVar-Dynamic.html#t%3AKey" TARGET="main" +>Key</A +> </DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetTMVars" TARGET="main" +>getTMVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetTMVarsIO" TARGET="main" +>getTMVarsIO</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDResource" TARGET="main" +>withDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDResources" TARGET="main" +>withDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithDSTMResources" TARGET="main" +>withDSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetDResource" TARGET="main" +>getDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetDResources" TARGET="main" +>getDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteDResource" TARGET="main" +>deleteDResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteDResources" TARGET="main" +>deleteDResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithResource" TARGET="main" +>withResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithResources" TARGET="main" +>withResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AwithSTMResources" TARGET="main" +>withSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetResource" TARGET="main" +>getResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AgetResources" TARGET="main" +>getResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteResource" TARGET="main" +>deleteResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar-Dynamic.html#v%3AdeleteResources" TARGET="main" +>deleteResources</A +></DIV +></DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache-TMVar.html view
@@ -0,0 +1,87 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache.TMVar</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache.TMVar</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache-TMVar.html#t%3AIResource" TARGET="main" +>IResource</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache-TMVar.html#t%3AResources" TARGET="main" +>Resources</A +> a b</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3Aresources" TARGET="main" +>resources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AgetTMVars" TARGET="main" +>getTMVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AgetTMVarsIO" TARGET="main" +>getTMVarsIO</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AwithSTMResources" TARGET="main" +>withSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AwithResources" TARGET="main" +>withResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AwithResource" TARGET="main" +>withResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AgetResources" TARGET="main" +>getResources</A +></DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache-TMVar.html#t%3ACache" TARGET="main" +>Cache</A +> a</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AsetCache" TARGET="main" +>setCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AnewCache" TARGET="main" +>newCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3Arefcache" TARGET="main" +>refcache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AclearSyncCacheProc" TARGET="main" +>clearSyncCacheProc</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache-TMVar.html#v%3AdefaultCheck" TARGET="main" +>defaultCheck</A +></DIV +> </DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/mini_Data-TCache.html view
@@ -0,0 +1,107 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--Rendered using the Haskell Html Library v0.2--> +<HTML +><HEAD +><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" +><TITLE +>Data.TCache</TITLE +><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" +><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" +></SCRIPT +></HEAD +><BODY +><DIV CLASS="outer" +><DIV CLASS="mini-topbar" +>Data.TCache</DIV +><DIV CLASS="mini-synopsis" +><DIV CLASS="decl" +><SPAN CLASS="keyword" +>class</SPAN +> <A HREF="Data-TCache.html#t%3AIResource" TARGET="main" +>IResource</A +> a</DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>data</SPAN +> <A HREF="Data-TCache.html#t%3AResources" TARGET="main" +>Resources</A +> a b</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3Aresources" TARGET="main" +>resources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AgetTVars" TARGET="main" +>getTVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AreleaseTVars" TARGET="main" +>releaseTVars</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AgetTVarsIO" TARGET="main" +>getTVarsIO</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AwithSTMResources" TARGET="main" +>withSTMResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AwithResources" TARGET="main" +>withResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AwithResource" TARGET="main" +>withResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AgetResources" TARGET="main" +>getResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AgetResource" TARGET="main" +>getResource</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AdeleteResources" TARGET="main" +>deleteResources</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AdeleteResource" TARGET="main" +>deleteResource</A +></DIV +> <DIV CLASS="decl" +><SPAN CLASS="keyword" +>type</SPAN +> <A HREF="Data-TCache.html#t%3ACache" TARGET="main" +>Cache</A +> a</DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AsetCache" TARGET="main" +>setCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AnewCache" TARGET="main" +>newCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3Arefcache" TARGET="main" +>refcache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AsyncCache" TARGET="main" +>syncCache</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AclearSyncCacheProc" TARGET="main" +>clearSyncCacheProc</A +></DIV +> <DIV CLASS="decl" +><A HREF="Data-TCache.html#v%3AdefaultCheck" TARGET="main" +>defaultCheck</A +></DIV +> </DIV +></DIV +></BODY +></HTML +>
+ dist/doc/html/TCache/minus.gif view
binary file changed (absent → 56 bytes)
+ dist/doc/html/TCache/plus.gif view
binary file changed (absent → 59 bytes)
+ dist/setup-config view
@@ -0,0 +1,2 @@+Saved package config for TCache-0.6.4 written by Cabal-1.6.0.3 using ghc-6.10+LocalBuildInfo {installDirTemplates = InstallDirs {prefix = "C:\\Archivos de programa\\Haskell", bindir = "$prefix\\bin", libdir = "$prefix", libsubdir = "$pkgid\\$compiler", dynlibdir = "$libdir", libexecdir = "$prefix\\$pkgid", progdir = "$libdir\\hugs\\programs", includedir = "$libdir\\$libsubdir\\include", datadir = "C:\\Archivos de programa\\Haskell", datasubdir = "$pkgid", docdir = "$prefix\\doc\\$pkgid", mandir = "$datadir\\man", htmldir = "$docdir\\html", haddockdir = "$htmldir"}, compiler = Compiler {compilerId = CompilerId GHC (Version {versionBranch = [6,10,3], versionTags = []}), compilerExtensions = [(CPP,"-XCPP"),(PostfixOperators,"-XPostfixOperators"),(PatternGuards,"-XPatternGuards"),(UnicodeSyntax,"-XUnicodeSyntax"),(MagicHash,"-XMagicHash"),(PolymorphicComponents,"-XPolymorphicComponents"),(ExistentialQuantification,"-XExistentialQuantification"),(KindSignatures,"-XKindSignatures"),(EmptyDataDecls,"-XEmptyDataDecls"),(ParallelListComp,"-XParallelListComp"),(TransformListComp,"-XTransformListComp"),(ForeignFunctionInterface,"-XForeignFunctionInterface"),(UnliftedFFITypes,"-XUnliftedFFITypes"),(LiberalTypeSynonyms,"-XLiberalTypeSynonyms"),(Rank2Types,"-XRank2Types"),(RankNTypes,"-XRankNTypes"),(ImpredicativeTypes,"-XImpredicativeTypes"),(TypeOperators,"-XTypeOperators"),(RecursiveDo,"-XRecursiveDo"),(Arrows,"-XArrows"),(UnknownExtension "PArr","-XPArr"),(TemplateHaskell,"-XTemplateHaskell"),(QuasiQuotes,"-XQuasiQuotes"),(Generics,"-XGenerics"),(NoImplicitPrelude,"-XNoImplicitPrelude"),(RecordWildCards,"-XRecordWildCards"),(NamedFieldPuns,"-XNamedFieldPuns"),(RecordPuns,"-XRecordPuns"),(DisambiguateRecordFields,"-XDisambiguateRecordFields"),(OverloadedStrings,"-XOverloadedStrings"),(GADTs,"-XGADTs"),(ViewPatterns,"-XViewPatterns"),(TypeFamilies,"-XTypeFamilies"),(BangPatterns,"-XBangPatterns"),(NoMonomorphismRestriction,"-XNoMonomorphismRestriction"),(NoMonoPatBinds,"-XNoMonoPatBinds"),(RelaxedPolyRec,"-XRelaxedPolyRec"),(ExtendedDefaultRules,"-XExtendedDefaultRules"),(ImplicitParams,"-XImplicitParams"),(ScopedTypeVariables,"-XScopedTypeVariables"),(PatternSignatures,"-XPatternSignatures"),(UnboxedTuples,"-XUnboxedTuples"),(StandaloneDeriving,"-XStandaloneDeriving"),(DeriveDataTypeable,"-XDeriveDataTypeable"),(TypeSynonymInstances,"-XTypeSynonymInstances"),(FlexibleContexts,"-XFlexibleContexts"),(FlexibleInstances,"-XFlexibleInstances"),(ConstrainedClassMethods,"-XConstrainedClassMethods"),(MultiParamTypeClasses,"-XMultiParamTypeClasses"),(FunctionalDependencies,"-XFunctionalDependencies"),(GeneralizedNewtypeDeriving,"-XGeneralizedNewtypeDeriving"),(OverlappingInstances,"-XOverlappingInstances"),(UndecidableInstances,"-XUndecidableInstances"),(IncoherentInstances,"-XIncoherentInstances"),(PackageImports,"-XPackageImports"),(NewQualifiedOperators,"-XNewQualifiedOperators")]}, buildDir = "dist\\build", scratchDir = "dist\\scratch", packageDeps = [PackageIdentifier {pkgName = PackageName "RefSerialize", pkgVersion = Version {versionBranch = [0,2,4], versionTags = []}},PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [3,0,3,1], versionTags = []}},PackageIdentifier {pkgName = PackageName "containers", pkgVersion = Version {versionBranch = [0,2,0,1], versionTags = []}},PackageIdentifier {pkgName = PackageName "directory", pkgVersion = Version {versionBranch = [1,0,0,3], versionTags = []}},PackageIdentifier {pkgName = PackageName "old-time", pkgVersion = Version {versionBranch = [1,0,0,2], versionTags = []}},PackageIdentifier {pkgName = PackageName "stm", pkgVersion = Version {versionBranch = [2,1,1,2], versionTags = []}}], installedPkgs = PackageIndex (fromList [(PackageName "RefSerialize",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "RefSerialize", pkgVersion = Version {versionBranch = [0,2,4], versionTags = []}}, license = BSD3, copyright = "", maintainer = "agocorona@gmail.com", author = "Alberto G\243mez Corona", stability = "", homepage = "", pkgUrl = "", description = "Read, Show and Data.Binary do not check for repeated references to the same address.\nAs a result, the data is duplicated when serialized. This is a waste of space in the filesystem\nand also a waste of serialization time. but the worst consequence is that, when the serialized data is read,\nit allocates multiple copies for the same object when referenced multiple times. Because multiple referenced\ndata is very typical in a pure language such is Haskell, this means that the resulting data loose the beatiful\neconomy of space and processing time that referential transparency permits.\nEvery instance of Show/Read is also a instance of Data.RefSerialize.\nThis package allows the serialization and deserialization of large data structures without duplication of data, with\nthe result of optimized performance and memory usage. It is also useful for debugging purposes.\nThere are automatic derived instances for instances of Read/Show. Lists of non-chars have its own instance.\nThe deserializer contains a subset of Parsec.Token for defining deserializing parsers.\nthe serialized string has the form \"expr( var1, ...varn) where var1=value1,..valn=valueN \" so that the\nstring can be EVALuated. So the entire deserialization can be substituted by eval.\nSee demo.hs and tutorial. I presumably will add a entry in haskell-web.blogspot.com\nin this release:.\n* Proper trailing withespace handlling for instances of Read\n* Error handllig for instances of Read.\nTo do: -derived instances for Data.Binary\n-serialization to/from ByteStings", category = "Parsing", exposed = True, exposedModules = [ModuleName ["Data","RefSerialize"],ModuleName ["Data","Parser"],ModuleName ["Data","Serialize"]], hiddenModules = [], importDirs = ["C:\\Archivos de programa\\Haskell\\RefSerialize-0.2.4\\ghc-6.10.3"], libraryDirs = ["C:\\Archivos de programa\\Haskell\\RefSerialize-0.2.4\\ghc-6.10.3"], hsLibraries = ["HSRefSerialize-0.2.4"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "containers", pkgVersion = Version {versionBranch = [0,2,0,1], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\Archivos de programa\\Haskell\\doc\\RefSerialize-0.2.4\\html\\RefSerialize.haddock"], haddockHTMLs = ["C:\\Archivos de programa\\Haskell\\doc\\RefSerialize-0.2.4\\html"]}]),(PackageName "Win32",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "Win32", pkgVersion = Version {versionBranch = [2,2,0,0], versionTags = []}}, license = BSD3, copyright = "Alastair Reid, 1999-2003", maintainer = "Esa Ilari Vuokko <ei@vuokko.info>", author = "Alastair Reid", stability = "", homepage = "", pkgUrl = "", description = "", category = "System, Graphics", exposed = True, exposedModules = [ModuleName ["Graphics","Win32","GDI"],ModuleName ["Graphics","Win32","GDI","Bitmap"],ModuleName ["Graphics","Win32","GDI","Brush"],ModuleName ["Graphics","Win32","GDI","Clip"],ModuleName ["Graphics","Win32","GDI","Font"],ModuleName ["Graphics","Win32","GDI","Graphics2D"],ModuleName ["Graphics","Win32","GDI","HDC"],ModuleName ["Graphics","Win32","GDI","Palette"],ModuleName ["Graphics","Win32","GDI","Path"],ModuleName ["Graphics","Win32","GDI","Pen"],ModuleName ["Graphics","Win32","GDI","Region"],ModuleName ["Graphics","Win32","GDI","Types"],ModuleName ["Graphics","Win32"],ModuleName ["Graphics","Win32","Control"],ModuleName ["Graphics","Win32","Dialogue"],ModuleName ["Graphics","Win32","Icon"],ModuleName ["Graphics","Win32","Key"],ModuleName ["Graphics","Win32","Menu"],ModuleName ["Graphics","Win32","Message"],ModuleName ["Graphics","Win32","Misc"],ModuleName ["Graphics","Win32","Resource"],ModuleName ["Graphics","Win32","Window"],ModuleName ["System","Win32"],ModuleName ["System","Win32","DebugApi"],ModuleName ["System","Win32","DLL"],ModuleName ["System","Win32","File"],ModuleName ["System","Win32","FileMapping"],ModuleName ["System","Win32","Info"],ModuleName ["System","Win32","Mem"],ModuleName ["System","Win32","NLS"],ModuleName ["System","Win32","Process"],ModuleName ["System","Win32","Registry"],ModuleName ["System","Win32","SimpleMAPI"],ModuleName ["System","Win32","Time"],ModuleName ["System","Win32","Console"],ModuleName ["System","Win32","Security"],ModuleName ["System","Win32","Types"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\Win32-2.2.0.0"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\Win32-2.2.0.0"], hsLibraries = ["HSWin32-2.2.0.0"], extraLibraries = ["user32","gdi32","winmm","kernel32","advapi32"], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3\\Win32-2.2.0.0\\include"], includes = ["HsWin32.h","HsGDI.h","WndProc.h"], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "bytestring", pkgVersion = Version {versionBranch = [0,9,1,4], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/Win32\\Win32.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/Win32"]}]),(PackageName "array",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "array", pkgVersion = Version {versionBranch = [0,2,0,0], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package defines the classes @IArray@ of immutable arrays and\n@MArray@ of arrays mutable within appropriate monads, as well as\nsome instances of these classes.", category = "Data Structures", exposed = True, exposedModules = [ModuleName ["Data","Array","Base"],ModuleName ["Data","Array","Diff"],ModuleName ["Data","Array","IArray"],ModuleName ["Data","Array","IO"],ModuleName ["Data","Array","IO","Internals"],ModuleName ["Data","Array","MArray"],ModuleName ["Data","Array","ST"],ModuleName ["Data","Array","Storable"],ModuleName ["Data","Array","Unboxed"],ModuleName ["Data","Array"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\array-0.2.0.0"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\array-0.2.0.0"], hsLibraries = ["HSarray-0.2.0.0"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "syb", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/array\\array.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/array"]}]),(PackageName "base",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [3,0,3,1], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This is a backwards-compatible version of the base package.\nIt depends on a later version of base, and was probably supplied\nwith your compiler when it was installed.", category = "", exposed = True, exposedModules = [ModuleName ["Data","Generics"],ModuleName ["Data","Generics","Aliases"],ModuleName ["Data","Generics","Basics"],ModuleName ["Data","Generics","Instances"],ModuleName ["Data","Generics","Schemes"],ModuleName ["Data","Generics","Text"],ModuleName ["Data","Generics","Twins"],ModuleName ["Foreign","Concurrent"],ModuleName ["GHC","Arr"],ModuleName ["GHC","Base"],ModuleName ["GHC","Conc"],ModuleName ["GHC","ConsoleHandler"],ModuleName ["GHC","Desugar"],ModuleName ["GHC","Dotnet"],ModuleName ["GHC","Enum"],ModuleName ["GHC","Environment"],ModuleName ["GHC","Err"],ModuleName ["GHC","Exception"],ModuleName ["GHC","Exts"],ModuleName ["GHC","Float"],ModuleName ["GHC","ForeignPtr"],ModuleName ["GHC","Handle"],ModuleName ["GHC","IO"],ModuleName ["GHC","IOBase"],ModuleName ["GHC","Int"],ModuleName ["GHC","List"],ModuleName ["GHC","Num"],ModuleName ["GHC","PArr"],ModuleName ["GHC","Pack"],ModuleName ["GHC","Ptr"],ModuleName ["GHC","Read"],ModuleName ["GHC","Real"],ModuleName ["GHC","ST"],ModuleName ["GHC","STRef"],ModuleName ["GHC","Show"],ModuleName ["GHC","Stable"],ModuleName ["GHC","Storable"],ModuleName ["GHC","TopHandler"],ModuleName ["GHC","Unicode"],ModuleName ["GHC","Weak"],ModuleName ["GHC","Word"],ModuleName ["System","Timeout"],ModuleName ["Control","Applicative"],ModuleName ["Control","Arrow"],ModuleName ["Control","Category"],ModuleName ["Control","Concurrent"],ModuleName ["Control","Concurrent","Chan"],ModuleName ["Control","Concurrent","MVar"],ModuleName ["Control","Concurrent","QSem"],ModuleName ["Control","Concurrent","QSemN"],ModuleName ["Control","Concurrent","SampleVar"],ModuleName ["Control","Exception"],ModuleName ["Control","Monad"],ModuleName ["Control","Monad","Fix"],ModuleName ["Control","Monad","Instances"],ModuleName ["Control","Monad","ST"],ModuleName ["Control","Monad","ST","Lazy"],ModuleName ["Control","Monad","ST","Strict"],ModuleName ["Data","Bits"],ModuleName ["Data","Bool"],ModuleName ["Data","Char"],ModuleName ["Data","Complex"],ModuleName ["Data","Dynamic"],ModuleName ["Data","Either"],ModuleName ["Data","Eq"],ModuleName ["Data","Fixed"],ModuleName ["Data","Foldable"],ModuleName ["Data","Function"],ModuleName ["Data","HashTable"],ModuleName ["Data","IORef"],ModuleName ["Data","Int"],ModuleName ["Data","Ix"],ModuleName ["Data","List"],ModuleName ["Data","Maybe"],ModuleName ["Data","Monoid"],ModuleName ["Data","Ord"],ModuleName ["Data","Ratio"],ModuleName ["Data","STRef"],ModuleName ["Data","STRef","Lazy"],ModuleName ["Data","STRef","Strict"],ModuleName ["Data","String"],ModuleName ["Data","Traversable"],ModuleName ["Data","Tuple"],ModuleName ["Data","Typeable"],ModuleName ["Data","Unique"],ModuleName ["Data","Version"],ModuleName ["Data","Word"],ModuleName ["Debug","Trace"],ModuleName ["Foreign"],ModuleName ["Foreign","C"],ModuleName ["Foreign","C","Error"],ModuleName ["Foreign","C","String"],ModuleName ["Foreign","C","Types"],ModuleName ["Foreign","ForeignPtr"],ModuleName ["Foreign","Marshal"],ModuleName ["Foreign","Marshal","Alloc"],ModuleName ["Foreign","Marshal","Array"],ModuleName ["Foreign","Marshal","Error"],ModuleName ["Foreign","Marshal","Pool"],ModuleName ["Foreign","Marshal","Utils"],ModuleName ["Foreign","Ptr"],ModuleName ["Foreign","StablePtr"],ModuleName ["Foreign","Storable"],ModuleName ["Numeric"],ModuleName ["Prelude"],ModuleName ["System","Console","GetOpt"],ModuleName ["System","CPUTime"],ModuleName ["System","Environment"],ModuleName ["System","Exit"],ModuleName ["System","IO"],ModuleName ["System","IO","Error"],ModuleName ["System","IO","Unsafe"],ModuleName ["System","Info"],ModuleName ["System","Mem"],ModuleName ["System","Mem","StableName"],ModuleName ["System","Mem","Weak"],ModuleName ["System","Posix","Internals"],ModuleName ["System","Posix","Types"],ModuleName ["Text","ParserCombinators","ReadP"],ModuleName ["Text","ParserCombinators","ReadPrec"],ModuleName ["Text","Printf"],ModuleName ["Text","Read"],ModuleName ["Text","Read","Lex"],ModuleName ["Text","Show"],ModuleName ["Text","Show","Functions"],ModuleName ["Unsafe","Coerce"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\base-3.0.3.1"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\base-3.0.3.1"], hsLibraries = ["HSbase-3.0.3.1"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "syb", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/base\\base.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/base"]},InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package contains the Prelude and its support libraries,\nand a large collection of useful libraries ranging from data\nstructures to parsing combinators and debugging utilities.", category = "", exposed = True, exposedModules = [ModuleName ["Foreign","Concurrent"],ModuleName ["GHC","Arr"],ModuleName ["GHC","Base"],ModuleName ["GHC","Classes"],ModuleName ["GHC","Conc"],ModuleName ["GHC","ConsoleHandler"],ModuleName ["GHC","Desugar"],ModuleName ["GHC","Enum"],ModuleName ["GHC","Environment"],ModuleName ["GHC","Err"],ModuleName ["GHC","Exception"],ModuleName ["GHC","Exts"],ModuleName ["GHC","Float"],ModuleName ["GHC","ForeignPtr"],ModuleName ["GHC","Handle"],ModuleName ["GHC","IO"],ModuleName ["GHC","IOBase"],ModuleName ["GHC","Int"],ModuleName ["GHC","List"],ModuleName ["GHC","Num"],ModuleName ["GHC","PArr"],ModuleName ["GHC","Pack"],ModuleName ["GHC","Ptr"],ModuleName ["GHC","Read"],ModuleName ["GHC","Real"],ModuleName ["GHC","ST"],ModuleName ["GHC","STRef"],ModuleName ["GHC","Show"],ModuleName ["GHC","Stable"],ModuleName ["GHC","Storable"],ModuleName ["GHC","TopHandler"],ModuleName ["GHC","Unicode"],ModuleName ["GHC","Weak"],ModuleName ["GHC","Word"],ModuleName ["System","Timeout"],ModuleName ["Control","Applicative"],ModuleName ["Control","Arrow"],ModuleName ["Control","Category"],ModuleName ["Control","Concurrent"],ModuleName ["Control","Concurrent","Chan"],ModuleName ["Control","Concurrent","MVar"],ModuleName ["Control","Concurrent","QSem"],ModuleName ["Control","Concurrent","QSemN"],ModuleName ["Control","Concurrent","SampleVar"],ModuleName ["Control","Exception"],ModuleName ["Control","Exception","Base"],ModuleName ["Control","OldException"],ModuleName ["Control","Monad"],ModuleName ["Control","Monad","Fix"],ModuleName ["Control","Monad","Instances"],ModuleName ["Control","Monad","ST"],ModuleName ["Control","Monad","ST","Lazy"],ModuleName ["Control","Monad","ST","Strict"],ModuleName ["Data","Bits"],ModuleName ["Data","Bool"],ModuleName ["Data","Char"],ModuleName ["Data","Complex"],ModuleName ["Data","Dynamic"],ModuleName ["Data","Either"],ModuleName ["Data","Eq"],ModuleName ["Data","Data"],ModuleName ["Data","Fixed"],ModuleName ["Data","Foldable"],ModuleName ["Data","Function"],ModuleName ["Data","HashTable"],ModuleName ["Data","IORef"],ModuleName ["Data","Int"],ModuleName ["Data","Ix"],ModuleName ["Data","List"],ModuleName ["Data","Maybe"],ModuleName ["Data","Monoid"],ModuleName ["Data","Ord"],ModuleName ["Data","Ratio"],ModuleName ["Data","STRef"],ModuleName ["Data","STRef","Lazy"],ModuleName ["Data","STRef","Strict"],ModuleName ["Data","String"],ModuleName ["Data","Traversable"],ModuleName ["Data","Tuple"],ModuleName ["Data","Typeable"],ModuleName ["Data","Unique"],ModuleName ["Data","Version"],ModuleName ["Data","Word"],ModuleName ["Debug","Trace"],ModuleName ["Foreign"],ModuleName ["Foreign","C"],ModuleName ["Foreign","C","Error"],ModuleName ["Foreign","C","String"],ModuleName ["Foreign","C","Types"],ModuleName ["Foreign","ForeignPtr"],ModuleName ["Foreign","Marshal"],ModuleName ["Foreign","Marshal","Alloc"],ModuleName ["Foreign","Marshal","Array"],ModuleName ["Foreign","Marshal","Error"],ModuleName ["Foreign","Marshal","Pool"],ModuleName ["Foreign","Marshal","Utils"],ModuleName ["Foreign","Ptr"],ModuleName ["Foreign","StablePtr"],ModuleName ["Foreign","Storable"],ModuleName ["Numeric"],ModuleName ["Prelude"],ModuleName ["System","Console","GetOpt"],ModuleName ["System","CPUTime"],ModuleName ["System","Environment"],ModuleName ["System","Exit"],ModuleName ["System","IO"],ModuleName ["System","IO","Error"],ModuleName ["System","IO","Unsafe"],ModuleName ["System","Info"],ModuleName ["System","Mem"],ModuleName ["System","Mem","StableName"],ModuleName ["System","Mem","Weak"],ModuleName ["System","Posix","Internals"],ModuleName ["System","Posix","Types"],ModuleName ["Text","ParserCombinators","ReadP"],ModuleName ["Text","ParserCombinators","ReadPrec"],ModuleName ["Text","Printf"],ModuleName ["Text","Read"],ModuleName ["Text","Read","Lex"],ModuleName ["Text","Show"],ModuleName ["Text","Show","Functions"],ModuleName ["Unsafe","Coerce"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\base-4.1.0.0"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\base-4.1.0.0"], hsLibraries = ["HSbase-4.1.0.0"], extraLibraries = ["wsock32","msvcrt","kernel32","user32","shell32"], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3\\base-4.1.0.0\\include"], includes = ["HsBase.h"], depends = [PackageIdentifier {pkgName = PackageName "ghc-prim", pkgVersion = Version {versionBranch = [0,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "integer", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}},PackageIdentifier {pkgName = PackageName "rts", pkgVersion = Version {versionBranch = [1,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/base\\base.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/base"]}]),(PackageName "bytestring",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "bytestring", pkgVersion = Version {versionBranch = [0,9,1,4], versionTags = []}}, license = BSD3, copyright = "Copyright (c) Don Stewart 2005-2008,\n(c) Duncan Coutts 2006-2008,\n(c) David Roundy 2003-2005.", maintainer = "dons@galois.com, duncan@haskell.org", author = "Don Stewart, Duncan Coutts", stability = "provisional", homepage = "http://www.cse.unsw.edu.au/~dons/fps.html", pkgUrl = "", description = "A time and space-efficient implementation of byte vectors using\npacked Word8 arrays, suitable for high performance use, both in terms\nof large data quantities, or high speed requirements. Byte vectors\nare encoded as strict 'Word8' arrays of bytes, and lazy lists of\nstrict chunks, held in a 'ForeignPtr', and can be passed between C\nand Haskell with little effort.\n\nTest coverage data for this library is available at:\n<http://code.haskell.org/~dons/tests/bytestring/hpc_index.html>", category = "Data", exposed = True, exposedModules = [ModuleName ["Data","ByteString"],ModuleName ["Data","ByteString","Char8"],ModuleName ["Data","ByteString","Unsafe"],ModuleName ["Data","ByteString","Internal"],ModuleName ["Data","ByteString","Lazy"],ModuleName ["Data","ByteString","Lazy","Char8"],ModuleName ["Data","ByteString","Lazy","Internal"],ModuleName ["Data","ByteString","Fusion"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\bytestring-0.9.1.4"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\bytestring-0.9.1.4"], hsLibraries = ["HSbytestring-0.9.1.4"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3\\bytestring-0.9.1.4\\include"], includes = ["fpstring.h"], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "ghc-prim", pkgVersion = Version {versionBranch = [0,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/bytestring\\bytestring.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/bytestring"]}]),(PackageName "containers",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "containers", pkgVersion = Version {versionBranch = [0,2,0,1], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package contains efficient general-purpose implementations\nof various basic immutable container types. The declared cost of\neach operation is either worst-case or amortized, but remains\nvalid even if structures are shared.", category = "Data Structures", exposed = True, exposedModules = [ModuleName ["Data","Graph"],ModuleName ["Data","IntMap"],ModuleName ["Data","IntSet"],ModuleName ["Data","Map"],ModuleName ["Data","Sequence"],ModuleName ["Data","Set"],ModuleName ["Data","Tree"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\containers-0.2.0.1"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\containers-0.2.0.1"], hsLibraries = ["HScontainers-0.2.0.1"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "array", pkgVersion = Version {versionBranch = [0,2,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/containers\\containers.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/containers"]}]),(PackageName "directory",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "directory", pkgVersion = Version {versionBranch = [1,0,0,3], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package provides a library for handling directories.", category = "System", exposed = True, exposedModules = [ModuleName ["System","Directory"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\directory-1.0.0.3"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\directory-1.0.0.3"], hsLibraries = ["HSdirectory-1.0.0.3"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3\\directory-1.0.0.3\\include"], includes = ["HsDirectory.h"], depends = [PackageIdentifier {pkgName = PackageName "Win32", pkgVersion = Version {versionBranch = [2,2,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "filepath", pkgVersion = Version {versionBranch = [1,1,0,2], versionTags = []}},PackageIdentifier {pkgName = PackageName "old-time", pkgVersion = Version {versionBranch = [1,0,0,2], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/directory\\directory.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/directory"]}]),(PackageName "filepath",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "filepath", pkgVersion = Version {versionBranch = [1,1,0,2], versionTags = []}}, license = BSD3, copyright = "", maintainer = "", author = "Neil Mitchell", stability = "", homepage = "http://www-users.cs.york.ac.uk/~ndm/filepath/", pkgUrl = "", description = "", category = "System", exposed = True, exposedModules = [ModuleName ["System","FilePath"],ModuleName ["System","FilePath","Posix"],ModuleName ["System","FilePath","Windows"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\filepath-1.1.0.2"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\filepath-1.1.0.2"], hsLibraries = ["HSfilepath-1.1.0.2"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/filepath\\filepath.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/filepath"]}]),(PackageName "ghc-prim",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "ghc-prim", pkgVersion = Version {versionBranch = [0,1,0,0], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "GHC primitives.", category = "", exposed = True, exposedModules = [ModuleName ["GHC","Prim"],ModuleName ["GHC","Bool"],ModuleName ["GHC","Generics"],ModuleName ["GHC","Ordering"],ModuleName ["GHC","PrimopWrappers"],ModuleName ["GHC","IntWord32"],ModuleName ["GHC","IntWord64"],ModuleName ["GHC","Tuple"],ModuleName ["GHC","Types"],ModuleName ["GHC","Unit"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\ghc-prim-0.1.0.0"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\ghc-prim-0.1.0.0"], hsLibraries = ["HSghc-prim-0.1.0.0"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "rts", pkgVersion = Version {versionBranch = [1,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/ghc-prim\\ghc-prim.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/ghc-prim"]}]),(PackageName "integer",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "integer", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package contains an Integer library based on GMP.", category = "", exposed = True, exposedModules = [ModuleName ["GHC","Integer"],ModuleName ["GHC","Integer","Internals"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\integer-0.1.0.1"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\integer-0.1.0.1"], hsLibraries = ["HSinteger-0.1.0.1"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "ghc-prim", pkgVersion = Version {versionBranch = [0,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/integer\\integer.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/integer"]}]),(PackageName "old-locale",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "old-locale", pkgVersion = Version {versionBranch = [1,0,0,1], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package provides the old locale library.\nFor new code, the new locale library is recommended.", category = "System", exposed = True, exposedModules = [ModuleName ["System","Locale"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\old-locale-1.0.0.1"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\old-locale-1.0.0.1"], hsLibraries = ["HSold-locale-1.0.0.1"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/old-locale\\old-locale.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/old-locale"]}]),(PackageName "old-time",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "old-time", pkgVersion = Version {versionBranch = [1,0,0,2], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package provides the old time library.\nFor new code, the new time library is recommended.", category = "System", exposed = True, exposedModules = [ModuleName ["System","Time"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\old-time-1.0.0.2"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\old-time-1.0.0.2"], hsLibraries = ["HSold-time-1.0.0.2"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3\\old-time-1.0.0.2\\include"], includes = ["HsTime.h"], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "old-locale", pkgVersion = Version {versionBranch = [1,0,0,1], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/old-time\\old-time.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/old-time"]}]),(PackageName "rts",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "rts", pkgVersion = Version {versionBranch = [1,0], versionTags = []}}, license = BSD3, copyright = "", maintainer = "glasgow-haskell-users@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "", category = "", exposed = True, exposedModules = [], hiddenModules = [], importDirs = [], libraryDirs = ["C:\\ghc\\ghc-6.10.3","C:\\ghc\\ghc-6.10.3/gcc-lib"], hsLibraries = ["HSrts"], extraLibraries = ["m","ffi","gmp","wsock32"], extraGHCiLibraries = [], includeDirs = ["C:\\ghc\\ghc-6.10.3/include","PAPI_INCLUDE_DIR"], includes = ["Stg.h"], depends = [], hugsOptions = [], ccOptions = [], ldOptions = ["-u","_ghczmprim_GHCziTypes_Izh_static_info","-u","_ghczmprim_GHCziTypes_Czh_static_info","-u","_ghczmprim_GHCziTypes_Fzh_static_info","-u","_ghczmprim_GHCziTypes_Dzh_static_info","-u","_base_GHCziPtr_Ptr_static_info","-u","_base_GHCziWord_Wzh_static_info","-u","_base_GHCziInt_I8zh_static_info","-u","_base_GHCziInt_I16zh_static_info","-u","_base_GHCziInt_I32zh_static_info","-u","_base_GHCziInt_I64zh_static_info","-u","_base_GHCziWord_W8zh_static_info","-u","_base_GHCziWord_W16zh_static_info","-u","_base_GHCziWord_W32zh_static_info","-u","_base_GHCziWord_W64zh_static_info","-u","_base_GHCziStable_StablePtr_static_info","-u","_ghczmprim_GHCziTypes_Izh_con_info","-u","_ghczmprim_GHCziTypes_Czh_con_info","-u","_ghczmprim_GHCziTypes_Fzh_con_info","-u","_ghczmprim_GHCziTypes_Dzh_con_info","-u","_base_GHCziPtr_Ptr_con_info","-u","_base_GHCziPtr_FunPtr_con_info","-u","_base_GHCziStable_StablePtr_con_info","-u","_ghczmprim_GHCziBool_False_closure","-u","_ghczmprim_GHCziBool_True_closure","-u","_base_GHCziPack_unpackCString_closure","-u","_base_GHCziIOBase_stackOverflow_closure","-u","_base_GHCziIOBase_heapOverflow_closure","-u","_base_ControlziExceptionziBase_nonTermination_closure","-u","_base_GHCziIOBase_blockedOnDeadMVar_closure","-u","_base_GHCziIOBase_blockedIndefinitely_closure","-u","_base_ControlziExceptionziBase_nestedAtomically_closure","-u","_base_GHCziWeak_runFinalizzerBatch_closure","-u","_base_GHCziTopHandler_runIO_closure","-u","_base_GHCziTopHandler_runNonIO_closure","-u","_base_GHCziConc_runHandlers_closure","-u","_base_GHCziConc_ensureIOManagerIsRunning_closure"], frameworkDirs = [], frameworks = [], haddockInterfaces = [], haddockHTMLs = []}]),(PackageName "stm",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "stm", pkgVersion = Version {versionBranch = [2,1,1,2], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "A modular composable concurrency abstraction.", category = "Concurrency", exposed = True, exposedModules = [ModuleName ["Control","Concurrent","STM"],ModuleName ["Control","Concurrent","STM","TArray"],ModuleName ["Control","Concurrent","STM","TVar"],ModuleName ["Control","Concurrent","STM","TChan"],ModuleName ["Control","Concurrent","STM","TMVar"],ModuleName ["Control","Monad","STM"]], hiddenModules = [ModuleName ["Control","Sequential","STM"]], importDirs = ["C:\\ghc\\ghc-6.10.3\\stm-2.1.1.2"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\stm-2.1.1.2"], hsLibraries = ["HSstm-2.1.1.2"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "array", pkgVersion = Version {versionBranch = [0,2,0,0], versionTags = []}},PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/stm\\stm.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/stm"]}]),(PackageName "syb",[InstalledPackageInfo {package = PackageIdentifier {pkgName = PackageName "syb", pkgVersion = Version {versionBranch = [0,1,0,1], versionTags = []}}, license = BSD3, copyright = "", maintainer = "libraries@haskell.org", author = "", stability = "", homepage = "", pkgUrl = "", description = "This package contains the generics system described in the\n/Scrap Your Boilerplate/ papers (see <http://www.cs.vu.nl/boilerplate/>).\nIt defines the @Data@ class of types permitting folding and unfolding\nof constructor applications, instances of this class for primitive\ntypes, and a variety of traversals.", category = "", exposed = True, exposedModules = [ModuleName ["Data","Generics"],ModuleName ["Data","Generics","Aliases"],ModuleName ["Data","Generics","Basics"],ModuleName ["Data","Generics","Instances"],ModuleName ["Data","Generics","Schemes"],ModuleName ["Data","Generics","Text"],ModuleName ["Data","Generics","Twins"]], hiddenModules = [], importDirs = ["C:\\ghc\\ghc-6.10.3\\syb-0.1.0.1"], libraryDirs = ["C:\\ghc\\ghc-6.10.3\\syb-0.1.0.1"], hsLibraries = ["HSsyb-0.1.0.1"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [PackageIdentifier {pkgName = PackageName "base", pkgVersion = Version {versionBranch = [4,1,0,0], versionTags = []}}], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["C:\\ghc\\ghc-6.10.3/doc/libraries/syb\\syb.haddock"], haddockHTMLs = ["$httptopdir/doc/libraries/syb"]}])]), pkgDescrFile = Just ".\\TCache.cabal", localPkgDescr = PackageDescription {package = PackageIdentifier {pkgName = PackageName "TCache", pkgVersion = Version {versionBranch = [0,6,4], versionTags = []}}, license = BSD3, licenseFile = "LICENSE", copyright = "", maintainer = "agocorona@gmail.com", author = "Alberto G\243mez Corona", stability = "", testedWith = [(GHC,ThisVersion (Version {versionBranch = [6,8,2], versionTags = []}))], homepage = "", pkgUrl = "", bugReports = "", sourceRepos = [], synopsis = "A Transactional data cache with configurable persistence", description = "Data.Tcache is a transactional cache with configurable persistence. It tries to simulate Hibernate\nfor Java or Rails for Ruby. The main difference is that transactions are done in memory trough STM.\nThere are transactional cache implementations for some J2EE servers like JBOSS.\n\nTCache uses STM. It can atomically apply a function to a list of cached objects. The resulting\nobjects go back to the cache (withResources). It also can retrieve these objects (getResources).\nPersistence can be syncronous (syncCache) or asyncronous, wtih configurable time between cache\nwrites and configurable cache clearance strategy. the size of the cache can be configured too .\nAll of this can be done trough clearSyncCacheProc. Even the TVar variables can be accessed\ndirectly (getTVar) to acceess all the semantic of atomic blocks while maintaining the persistence of the\nTVar updates.\n\nPersistence can be defined for each object: Each object must have a defined key, a default filename\npath (if applicable). Persistence is pre-defined in files, but the readResource writeResource and\ndelResource methods can be redefined to persist in databases or whatever.\n\nSerialization is also configurable.\n\nThere are Samples here that explain the main features.\n\nIn this release\n\n* added withSTMResources. Most of the rest of the methods are derived from withSTMResources . the results are returned in the STM monad, so this method can be part of al larger STM transaction\nIt also can perforn used defined retries.\n\n* added modules for cached TMVars\nData.TCache.TMVar and Data.TCache.TMVar.Dynamic uses TMVars instead of TVars (See Control.Concurrent.STM.TMVar)\n\nIt is not possible tu mix TVars and TMVars packages in the same executable. However code that uses dynamic and non dynamic can\ncan be mixed\n\n* Data.TCache - cached TVars of object of type a.\n\n* Data.TCache.Dynamic - cached TVars of objects of type IDynamic.\n\n* Data.TCache.TMVar - cached TMVars of objects of type a.\n\n* Data.TCache..TMVar.Dynamic - cached TMVars of objects of type IDynamic.", category = "Middleware, Data, Database, Concurrency", customFieldsPD = [], buildDepends = [Dependency (PackageName "RefSerialize") (UnionVersionRanges (ThisVersion (Version {versionBranch = [0,2,4], versionTags = []})) (LaterVersion (Version {versionBranch = [0,2,4], versionTags = []}))),Dependency (PackageName "base") (IntersectVersionRanges (UnionVersionRanges (ThisVersion (Version {versionBranch = [3], versionTags = []})) (LaterVersion (Version {versionBranch = [3], versionTags = []}))) (EarlierVersion (Version {versionBranch = [4], versionTags = []}))),Dependency (PackageName "containers") (UnionVersionRanges (ThisVersion (Version {versionBranch = [0,1,0,1], versionTags = []})) (LaterVersion (Version {versionBranch = [0,1,0,1], versionTags = []}))),Dependency (PackageName "directory") (UnionVersionRanges (ThisVersion (Version {versionBranch = [1,0], versionTags = []})) (LaterVersion (Version {versionBranch = [1,0], versionTags = []}))),Dependency (PackageName "old-time") (UnionVersionRanges (ThisVersion (Version {versionBranch = [1,0], versionTags = []})) (LaterVersion (Version {versionBranch = [1,0], versionTags = []}))),Dependency (PackageName "stm") (UnionVersionRanges (ThisVersion (Version {versionBranch = [2], versionTags = []})) (LaterVersion (Version {versionBranch = [2], versionTags = []})))], descCabalVersion = UnionVersionRanges (ThisVersion (Version {versionBranch = [1,2], versionTags = []})) (LaterVersion (Version {versionBranch = [1,2], versionTags = []})), buildType = Just Simple, library = Just (Library {exposedModules = [ModuleName ["Data","TCache"],ModuleName ["Data","TCache","IResource"],ModuleName ["Data","TCache","Dynamic"],ModuleName ["Data","TCache","TMVar"],ModuleName ["Data","TCache","TMVar","Dynamic"],ModuleName ["Data","TCache","IDynamic"]], libExposed = True, libBuildInfo = BuildInfo {buildable = True, buildTools = [], cppOptions = [], ccOptions = [], ldOptions = [], pkgconfigDepends = [], frameworks = [], cSources = [], hsSourceDirs = ["."], otherModules = [], extensions = [], extraLibs = [], extraLibDirs = [], includeDirs = [], includes = [], installIncludes = [], options = [(GHC,["-O2"])], ghcProfOptions = [], ghcSharedOptions = [], customFieldsBI = []}}), executables = [], dataFiles = [], dataDir = "", extraSrcFiles = [], extraTmpFiles = []}, withPrograms = [("ar",ConfiguredProgram {programId = "ar", programVersion = Nothing, programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\ar.exe"}}),("cpphs",ConfiguredProgram {programId = "cpphs", programVersion = Just (Version {versionBranch = [1,7], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\Archivos de programa\\Haskell\\bin\\cpphs.exe"}}),("gcc",ConfiguredProgram {programId = "gcc", programVersion = Just (Version {versionBranch = [3,4,5], versionTags = []}), programArgs = ["-BC:\\ghc\\ghc-6.10.3\\gcc-lib","-IC:\\ghc\\ghc-6.10.3\\include\\mingw"], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\gcc.exe"}}),("ghc",ConfiguredProgram {programId = "ghc", programVersion = Just (Version {versionBranch = [6,10,3], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\ghc.exe"}}),("ghc-pkg",ConfiguredProgram {programId = "ghc-pkg", programVersion = Just (Version {versionBranch = [6,10,3], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\ghc-pkg.exe"}}),("haddock",ConfiguredProgram {programId = "haddock", programVersion = Just (Version {versionBranch = [2,4,2], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\haddock.exe"}}),("happy",ConfiguredProgram {programId = "happy", programVersion = Just (Version {versionBranch = [1,18,4], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\happy.exe"}}),("hsc2hs",ConfiguredProgram {programId = "hsc2hs", programVersion = Just (Version {versionBranch = [0,67], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\bin\\hsc2hs.exe"}}),("hscolour",ConfiguredProgram {programId = "hscolour", programVersion = Just (Version {versionBranch = [1,13], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\Archivos de programa\\Haskell\\bin\\HsColour.exe"}}),("ld",ConfiguredProgram {programId = "ld", programVersion = Nothing, programArgs = ["-x"], programLocation = FoundOnSystem {locationPath = "C:\\ghc\\ghc-6.10.3\\gcc-lib\\ld.exe"}}),("pkg-config",ConfiguredProgram {programId = "pkg-config", programVersion = Just (Version {versionBranch = [0,23], versionTags = []}), programArgs = [], programLocation = FoundOnSystem {locationPath = "c:\\gtk2hs\\0.10.1\\bin\\pkg-config.exe"}}),("tar",ConfiguredProgram {programId = "tar", programVersion = Nothing, programArgs = [], programLocation = FoundOnSystem {locationPath = "C:\\Archivos de programa\\UnixUtils\\usr\\local\\wbin\\tar.exe"}})], withPackageDB = GlobalPackageDB, withVanillaLib = True, withProfLib = False, withSharedLib = False, withProfExe = False, withOptimization = NormalOptimisation, withGHCiLib = True, splitObjs = False, stripExes = True, progPrefix = "", progSuffix = ""}