packages feed

cache 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+6/−9 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

cache.cabal view
@@ -1,5 +1,5 @@ name:           cache-version:        0.1.0.0+version:        0.1.0.1 synopsis:       An in-memory key/value store with expiration support homepage:       https://github.com/hverr/haskell-cache#readme license:        BSD3
src/Data/Cache.hs view
@@ -6,9 +6,9 @@ -- Stability:   experimental -- -- An in-memory key/value store with expiration support, similar--- to patrickmn/go-cache for GO.+-- to patrickmn/go-cache for Go. ----- The cache is a shard mutable HashMap implemented using STM. It+-- The cache is a shared mutable HashMap implemented using STM. It -- supports item expiration.  module Data.Cache (@@ -78,11 +78,6 @@             | e < now'   = Just True             | otherwise = Just False -newCacheSTM :: Maybe TimeSpec -> STM (Cache k v)-newCacheSTM d = do-    m <- newTVar HM.empty-    return Cache { container = m, defaultExpiration = d }- -- | Create a new cache with a default expiration value for newly -- added cache items. --@@ -92,7 +87,9 @@ -- If the specified default expiration value is `Nothing`, items inserted -- by 'insert' will never expire. newCache :: Maybe TimeSpec -> IO (Cache k v)-newCache = atomically . newCacheSTM+newCache d = do+    m <- newTVarIO HM.empty+    return Cache { container = m, defaultExpiration = d }  copyCacheSTM :: Cache k v -> STM (Cache k v) copyCacheSTM c = do