hasql 0.7.0 → 0.7.1
raw patch · 3 files changed
+37/−9 lines, 3 filesdep ~monad-controlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: monad-control
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- hasql.cabal +2/−2
- library/Hasql.hs +32/−7
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 0.7.1+* Relaxed the dependency on "monad-control"+ # 0.7.0 - Refinements and minor updates * Streaming now is parameterized by the size of a chunk * Introduced a new type `Ex`
hasql.cabal view
@@ -1,7 +1,7 @@ name: hasql version:- 0.7.0+ 0.7.1 synopsis: A minimalistic general high level API for relational databases description:@@ -109,7 +109,7 @@ list-t >= 0.3.1 && < 0.5, mmorph == 1.0.*, mtl >= 2.1 && < 2.3,- monad-control == 1.0.*,+ monad-control >= 0.3 && < 1.1, transformers-base == 0.4.*, transformers >= 0.3 && < 0.5, base-prelude >= 0.1.3 && < 0.2,
library/Hasql.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE UndecidableInstances, CPP #-} -- | -- This is the API of the \"hasql\" library. -- For an introduction to the package @@ -161,6 +161,16 @@ instance MonadTrans (Session c) where lift = Session . lift . lift +deriving instance MonadBase IO m => MonadBase IO (Session c m)++instance MFunctor (Session c) where+ hoist f (Session m) = + Session $ ReaderT $ \e ->+ EitherT $ f $ runEitherT $ flip runReaderT e $ m+++#if MIN_VERSION_monad_control(1,0,0)+ instance MonadTransControl (Session c) where type StT (Session c) a = Either (SessionError c) a liftWith onUnlift =@@ -170,17 +180,32 @@ restoreT = Session . ReaderT . const . EitherT -deriving instance MonadBase IO m => MonadBase IO (Session c m)- instance (MonadBaseControl IO m) => MonadBaseControl IO (Session c m) where type StM (Session c m) a = ComposeSt (Session c) m a liftBaseWith = defaultLiftBaseWith restoreM = defaultRestoreM -instance MFunctor (Session c) where- hoist f (Session m) = - Session $ ReaderT $ \e ->- EitherT $ f $ runEitherT $ flip runReaderT e $ m+#else++instance MonadTransControl (Session c) where+ newtype StT (Session c) a = + SessionStT (Either (SessionError c) a)+ liftWith onUnlift =+ Session $ ReaderT $ \e -> + lift $ onUnlift $ \(Session m) -> + liftM SessionStT $ runEitherT $ flip runReaderT e $ m+ restoreT = + Session . ReaderT . const . EitherT . liftM (\(SessionStT a) -> a)++instance (MonadBaseControl IO m) => MonadBaseControl IO (Session c m) where+ newtype StM (Session c m) a = + SessionStM (ComposeSt (Session c) m a)+ liftBaseWith = + defaultLiftBaseWith SessionStM+ restoreM = + defaultRestoreM $ \(SessionStM a) -> a+ +#endif -- | -- Execute a session using an established connection pool.