diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,9 @@
 # Changelog for Hedis
 
+## 0.12.12
+
+* PR #149. Make withConnect friendly to transformer stack
+
 ## 0.12.11
 
 * Expose `withCheckedConnect`, `withConnect`
diff --git a/hedis.cabal b/hedis.cabal
--- a/hedis.cabal
+++ b/hedis.cabal
@@ -1,5 +1,5 @@
 name:               hedis
-version:            0.12.11
+version:            0.12.12
 synopsis:
     Client library for the Redis datastore: supports full command set,
     pipelining.
@@ -73,6 +73,7 @@
                     base >= 4.8 && < 5,
                     bytestring >= 0.9,
                     bytestring-lexing >= 0.5,
+                    exceptions,
                     unordered-containers,
                     text,
                     deepseq,
@@ -141,6 +142,7 @@
 test-suite doctest
     type: exitcode-stdio-1.0
     main-is: DocTest.hs
+    ghc-options: -O0 -rtsopts
     build-depends:
         base == 4.*,
         doctest
diff --git a/src/Database/Redis/Core.hs b/src/Database/Redis/Core.hs
--- a/src/Database/Redis/Core.hs
+++ b/src/Database/Redis/Core.hs
@@ -18,6 +18,7 @@
 #endif
 import Control.Exception
 import Control.Monad.Reader
+import qualified Control.Monad.Catch as Catch
 import qualified Data.ByteString as B
 import Data.IORef
 import Data.Pool
@@ -250,12 +251,12 @@
 disconnect (Conn pool) = destroyAllResources pool
 
 -- | Memory bracket around 'connect' and 'disconnect'. 
-withConnect :: ConnectInfo -> (Connection -> IO c) -> IO c
-withConnect connInfo = bracket (connect connInfo) disconnect
+withConnect :: (Catch.MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c
+withConnect connInfo = Catch.bracket (liftIO $ connect connInfo) (liftIO . disconnect)
 
 -- | Memory bracket around 'checkedConnect' and 'disconnect'
-withCheckedConnect :: ConnectInfo -> (Connection -> IO c) -> IO c
-withCheckedConnect connInfo = bracket (checkedConnect connInfo) disconnect
+withCheckedConnect :: (Catch.MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c
+withCheckedConnect connInfo = Catch.bracket (liftIO $ checkedConnect connInfo) (liftIO . disconnect)
 
 -- The AUTH command. It has to be here because it is used in 'connect'.
 auth
