module Caching.ExpiringCacheMap.Internal.Types (
ECM(..),
CacheState(..),
ECMNewState,
ECMEnterState,
ECMReadState
) where
import qualified Control.Concurrent.MVar as MV
import Caching.ExpiringCacheMap.Utils.Types
type ECMNewState a b s m k v = (CacheState s m k v) -> a (b (CacheState s m k v))
type ECMEnterState a b s m k v = b (CacheState s m k v) -> ((CacheState s m k v) -> a ((CacheState s m k v), v)) -> a v
type ECMReadState a b s m k v = b (CacheState s m k v) -> a (CacheState s m k v)
newtype CacheState s m k v =
CacheState (Maybe s, m k (TimeUnits, TimeUnits, v), ([(k, ECMIncr)], ECMULength), ECMIncr)
newtype ECM a b s m k v = ECM ( b (CacheState s m k v),
Maybe s -> k -> a (TimeUnits, (Maybe s, v)),
a TimeUnits,
ECMMapSize,
ECMIncr,
ECMULength,
ECMULength,
ECMEnterState a b s m k v,
ECMReadState a b s m k v)