packages feed

Concurrent-Cache 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+5/−4 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Concurrent-Cache.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                Concurrent-Cache-version:             0.1.0.0+version:             0.1.0.1 synopsis:            A Cached variable for IO functions. description:         This package allows for caching IO functions, either on a                      timeout or designed to only fetch once.
Control/Concurrent/Cache.hs view
@@ -11,7 +11,8 @@       -- ^ @Cache@, the cache to fetch a value from       -> IO (a) fetch (ReadOnceCachedData mvar) = go where-  go = readMVar mvar >>= \cached -> do+  go = do+    cached <- readMVar mvar     case cached of       Left _ -> do         modifyMVar_ mvar $ \cached' -> case cached' of@@ -21,7 +22,8 @@       Right value -> return value  fetch (TimedCachedData (timeout, mvar)) = go where-  go = readMVar mvar >>= \(thread,_,value) -> do+  go = do+    (thread,_,value) <- readMVar mvar     case value of       Nothing -> do         modifyMVar_ mvar $ \mvar'@(threadId', action', value') -> case value' of@@ -34,7 +36,6 @@         modifyMVar_ mvar $ \(_, action', value') -> do           newThreadId <- forkIO $ do             threadDelay timeout-            putStrLn "Deleting"             modifyMVar_ mvar $ \(_, action'', _) -> return (Nothing, action'', Nothing)           return (Just newThreadId, action', value')         return value'