Stability | experimental |
---|---|
Maintainer | Roman Smr <roman.smrz@seznam.cz> |
Here is provided a Cache
type class designed to generalize notion of cache
currently used in Swapper.
- class Cache a v | a -> v where
- addValueRef :: Cache a v => IORef a -> v -> IO (IO ())
- data SomeCache v = forall c . Cache c v => SomeCache !c
- data ClockCache a = ClockCache {}
- mkClockCache :: Int -> IO (ClockCache a)
- data NullCache a = NullCache
- nullCache :: SomeCache a
Documentation
class Cache a v | a -> v whereSource
First parameter of this class is actual cache type, the second is type of cached values. The cache should just hold an reference to those values that are meant to be kept in memory.
data ClockCache a Source
Provides standard clock cache with second chance mechanism.
Typeable1 ClockCache | |
Cache (ClockCache a) a |
mkClockCache :: Int -> IO (ClockCache a)Source