úÎ W<SÄ7      !"#$%&'()*+,-./0123456 non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>,Types where values have a key for indexing. non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com> :A type class for implementing a caching policy (e.g. LRU) CA new element is added to the cache or an already existing element  was accessed.  Returns the "last"$ element w.r.t. the caching policy. Removes and returns the "last"$ element w.r.t. the caching policy. "Creates an empty cache structure. Checks for emptyness. *Transforms the cache structure to a list. An element is deleted. 0Checks if an element is in the cache structure. Returns the size. Should be O(1). Runs  3 a number of times. Has a default implementation.         non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>7non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>:This class needs to be instantiated when developing a new B backend. The backend is expected to be able to handle concurrent  (non-conflicting) requests. (Called when a new element was inserted. $Called when an element was updated. 1Called when an element was deleted from the map. 1Called when an element is not found in the map.  Called by  flushBackend and  purgeTMap.  Called in  newTMapIO non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>The binary-backend type UCreates a new backend that stores one file per entry in the given working directory. non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com> Creates a new .    non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>!The standard library type Data.Map repackaged as a ". "$The generic transactional map type. 8-An exception occurred in the retry IO action 9/Element exists neither in backend nor in cache : Cache miss ; Cache hit #KCreates a new TMap. You will need to use an apropriate backend and specify  the caching policy, e.g.,   D import Data.TMap.Backend.Binary( BinaryBackend,mkBinaryBackend ) ' import Data.CacheStructure.LRU(LRU) Ewill use a binary-serialization backend for persistent storage and a "least recently  used" caching algorithm. See $) for a less generic construction method. .Now, to create an unbounded map that uses the ' FM Int String' (see package EdisonCore)  as the map type, you can write    backend <- mkBinaryBackend " myworkdir" " mytempdir"  tmap <O- newTMapIO backend Nothing :: IO (TMap (FM.FM key) key val BinaryBackend LRU)  Note that $) provides an easier construction method.  See file  Sample.hs for further examples. $Creates an (unbounded) !. %OLooks for a given key in the map and (if necessary) in the persistent storage # and updates the map if necessary. &,Checks whether the given key is in the map. '1Adds a key-value mapping to the map. Can throw a   exception. (FApplies a function to the element identified by the key. Can throw an  exception. ))Removes a key from the map. Can throw an  exception. *JReduces the map to the appropriate size if the maximum size was exceeded.  Calls Data.TMap.Backend.flush if the map is purged.  Runs in O(1)- if the map size is within bounds, otherwise O(n). <JReduces the map to the appropriate size if the maximum size was exceeded.  Calls Data.TMap.Backend.flush if the map is purged.  Runs in O(1)- if the map size is within bounds, otherwise O(n).  Warning:D This function should only be called at the end of a transaction to % prevent nonterminating retry-loops! +"Sets the maximum size of the map. O(1)'. Note that the size of the TMap needs 7 to be reduced manually to the maximum size by calling  purgeTMap. ,"Gets the maximum size of the map. O(1). -"Gets the current size of the map. O(1). .=Causes the element to be reread from the backend on the next %.  Throws an ( exception if the entry does not exist. /=Causes the element to be reread from the backend on the next %. Does 5 not throw an error when the element does not exist. 0Sends a B.flush9 request to the backend. Useful for asynchronous backend  implementations. !"#$%&'()*+,-./0"!#$%')&(*,+-./0!"#$%&'()*+,-./0non-portable (requires STM) experimental$Peter Robinson <thaldyron@gmail.com>1GAdds a new element to the map. The key is automatically deduced by the   instantiation. 2MTries to fill a partially initialized value with data from the TMap. Returns  = 6 if the TMap does not contain a corresponding entry. 3DFills a partially initialized value with data from the TMap. Throws  an / exception if there is no corresponding entry. 4"Removes the element from the map. 5-Removes the entry that has the supplied key. 6KApplies a function to an element that might be only partially initialized. "#*123456 "#123456*123456 >?@ABC>?@A?@ABCD       !"#$%&'())*+,-./$"#0123456789:;<=>?@ABCD E F F G H I JKpersistent-map-0.3.4 Data.TMap Data.HasKeyData.CacheStructureData.TMap.BackendData.TMap.Backend.BinaryData.TMap.Backend.NoBackendData.TMap.Backend.StdoutBackend Data.TStorageData.TMap.ExceptionData.CacheStructure.LRUbase Data.MaybeSample TMapExceptionBackendExceptionTMapDefaultExc EntryNotFoundDuplicateEntryHasKeykeyCacheStructurehitlastpopemptynulltoListdeletemembersizepopManyCacheExceptionBackendinsertadjustlookupflush initialize BinaryBackendmkBinaryBackend NoBackend StdoutBackendnewStdoutBackend TFiniteMapTMap newTMapIOnewTFiniteMapIO purgeTMapIOsetMaximumSizegetMaximumSizegetCurrentSize markAsDirtytryMarkAsDirty flushBackendadd tryCompletecompleteremove removeByKeyapply LRU-0.1.1Data.LRULRUExc NotInBackend NotInTMapEntry purgeTMapNothingSometypetheidnamesampletest