Commits

Bryan O'Sullivan committed caf8342

Switch from MonadCatchIO-transformers to monad-control.

Apparently MonadCatchIO-transformers is quite buggy :-(

Comments (0)

Files changed (2)

 import Control.Concurrent (forkIO, killThread, myThreadId, threadDelay)
 import Control.Concurrent.STM
 import Control.Exception (SomeException, catch)
+import Control.Exception.Control (onException)
 import Control.Monad (forM_, forever, join, liftM2, unless, when)
-import Control.Monad.CatchIO (MonadCatchIO, onException)
 import Control.Monad.IO.Class (liftIO)
+import Control.Monad.IO.Control (MonadControlIO)
 import Data.Hashable (hash)
 import Data.List (partition)
 import Data.Time.Clock (NominalDiffTime, UTCTime, diffUTCTime, getCurrentTime)
 -- destroy a pooled resource, as doing so will almost certainly cause
 -- a subsequent user (who expects the resource to be valid) to throw
 -- an exception.
-withResource :: MonadCatchIO m => Pool a -> (a -> m b) -> m b
+withResource :: MonadControlIO m => Pool a -> (a -> m b) -> m b
 {-# SPECIALIZE withResource :: Pool a -> (a -> IO b) -> IO b #-}
 withResource Pool{..} act = do
   i <- liftIO $ ((`mod` numStripes) . hash) <$> myThreadId

resource-pool.cabal

 name:                resource-pool
-version:             0.1.1.0
+version:             0.2.0.0
 synopsis:            A high-performance striped resource pooling implementation
 description:
   A high-performance striped pooling abstraction for managing
   build-depends:       
     base == 4.*,
     hashable,
-    MonadCatchIO-transformers,
+    monad-control >= 0.2.0.1,
     transformers,
     stm,
     time,