Skip to content

Commit 86d3918

Browse files
committed
Merge pull request #4 from helium/revert-3-feature/monad-base-control-instance
Revert "Implement instance of MonadBaseControl"
2 parents f48f1a7 + bcfa0c1 commit 86d3918

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

postgresql-transactional.cabal

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ library
2020
ghc-options: -Wall -Werror
2121
-- other-extensions:
2222
build-depends: base >= 4 && < 5
23-
, monad-control >= 1.0
24-
, mtl
2523
, postgresql-simple >= 0.4
26-
, transformers-base
24+
, mtl
2725
-- hs-source-dirs:
2826
default-language: Haskell2010

src/Database/PostgreSQL/TransactionalStore.hs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{-# LANGUAGE FlexibleInstances #-}
33
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
44
{-# LANGUAGE MultiParamTypeClasses #-}
5-
{-# LANGUAGE TypeFamilies #-}
65

76
module Database.PostgreSQL.TransactionalStore
87
( PGTransaction
@@ -20,29 +19,21 @@ module Database.PostgreSQL.TransactionalStore
2019
#if __GLASGOW_HASKELL__ < 710
2120
import Control.Applicative
2221
#endif
23-
import Control.Monad.Base (MonadBase)
24-
import Control.Monad.Trans.Control (MonadBaseControl(..))
2522
import Control.Monad.Reader
2623
import Data.Int
2724
import qualified Database.PostgreSQL.Simple as Postgres
2825
import Database.PostgreSQL.Simple.FromRow
2926
import Database.PostgreSQL.Simple.ToRow
3027

3128
newtype PGTransaction a =
32-
PGTransaction { unPGTransaction :: ReaderT Postgres.Connection IO a }
29+
PGTransaction (ReaderT Postgres.Connection IO a)
3330
deriving ( Functor
3431
, Applicative
3532
, Monad
3633
, MonadIO
3734
, MonadReader Postgres.Connection
38-
, MonadBase IO
3935
)
4036

41-
instance MonadBaseControl IO PGTransaction where
42-
type StM PGTransaction a = a
43-
liftBaseWith f = PGTransaction $ liftBaseWith $ \q -> f (q . unPGTransaction)
44-
restoreM = PGTransaction . restoreM
45-
4637
runPGTransaction :: MonadIO m => PGTransaction a -> Postgres.Connection -> m a
4738
runPGTransaction (PGTransaction pgTrans) conn =
4839
liftIO (Postgres.withTransaction conn (runReaderT pgTrans conn))

0 commit comments

Comments
 (0)