summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromanb <>2018-08-30 15:26:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-08-30 15:26:00 (GMT)
commit9b349747696418cf3a6c2252d5e258b6adbf6ea2 (patch)
treeebd44dbb59b76b8c880e8d8b71f21f4a37d9b425
parentca15a40cc928661454e88c0f30a3fec40660487f (diff)
version 1.0.0HEAD1.0.0master
-rw-r--r--CHANGELOG.md5
-rw-r--r--redis-io.cabal16
-rw-r--r--src/Database/Redis/IO/Client.hs16
-rw-r--r--src/Database/Redis/IO/Connection.hs3
-rw-r--r--src/Database/Redis/IO/Types.hs4
-rw-r--r--test/CommandTests.hs2
6 files changed, 17 insertions, 29 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4297819..af8ac08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+1.0.0
+-----------------------------------------------------------------------------
+- Drop support for GHC < 8.0.
+- Require redis-resp >= 1.0.
+
0.7.0
-----------------------------------------------------------------------------
- `pipelined` has been renamed to `commands`.
diff --git a/redis-io.cabal b/redis-io.cabal
index fb4d5d5..4700371 100644
--- a/redis-io.cabal
+++ b/redis-io.cabal
@@ -1,14 +1,14 @@
name: redis-io
-version: 0.7.0
+version: 1.0.0
synopsis: Yet another redis client.
license: MPL-2.0
license-file: LICENSE
author: Toralf Wittner
-maintainer: Toralf Wittner <tw@dtex.org>
+maintainer: Toralf Wittner <tw@dtex.org>,
+ Roman S. Borschel <roman@pkaboo.org>
copyright: (C) 2014 Toralf Wittner
homepage: https://gitlab.com/twittner/redis-io/
bug-reports: https://gitlab.com/twittner/redis-io/issues
-stability: experimental
category: Database
build-type: Simple
cabal-version: >= 1.10
@@ -39,21 +39,21 @@ library
build-depends:
attoparsec >= 0.12.1.2
, auto-update >= 0.1
- , base >= 4.5 && < 5
+ , base >= 4.9 && < 5
, bytestring >= 0.9
, containers >= 0.5
, exceptions >= 0.6
, iproute >= 1.3
- , monad-control >= 0.3
+ , monad-control >= 1.0
, mtl >= 2.1
- , network >= 2.5
+ , network >= 2.6.1
, operational >= 0.2
- , redis-resp >= 0.4
+ , redis-resp >= 1.0
, resource-pool >= 0.2
, semigroups >= 0.16
, stm >= 2.4
, time >= 1.4
- , transformers >= 0.3
+ , transformers >= 0.4
, transformers-base >= 0.4
, tinylog >= 0.10
diff --git a/src/Database/Redis/IO/Client.hs b/src/Database/Redis/IO/Client.hs
index d5efac0..e1f2a73 100644
--- a/src/Database/Redis/IO/Client.hs
+++ b/src/Database/Redis/IO/Client.hs
@@ -2,7 +2,6 @@
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -22,9 +21,7 @@ import Control.Monad.Operational
import Control.Monad.Reader (ReaderT (..), runReaderT, MonadReader, ask, asks)
import Control.Monad.Trans.Class
import Control.Monad.Trans.Control (MonadBaseControl (..))
-#if MIN_VERSION_transformers(0,4,0)
import Control.Monad.Trans.Except
-#endif
import Data.ByteString.Lazy (ByteString)
import Data.Int
import Data.IORef
@@ -72,21 +69,10 @@ newtype Client a = Client
instance MonadLogger Client where
log l m = asks logger >>= \g -> Logger.log g l m
-#if MIN_VERSION_monad_control(1,0,0)
instance MonadBaseControl IO Client where
type StM Client a = StM (ReaderT Pool IO) a
liftBaseWith f = Client $ liftBaseWith $ \run -> f (run . client)
restoreM = Client . restoreM
-#else
-instance MonadBaseControl IO Client where
- newtype StM Client a = ClientStM
- { unClientStM :: StM (ReaderT Pool IO) a }
-
- liftBaseWith f =
- Client $ liftBaseWith $ \run -> f (fmap ClientStM . run . client)
-
- restoreM = Client . restoreM . unClientStM
-#endif
-- | Monads in which 'Client' actions may be embedded.
class (Functor m, Applicative m, Monad m, MonadIO m, MonadCatch m) => MonadClient m
@@ -106,10 +92,8 @@ instance MonadClient m => MonadClient (S.StateT s m) where
instance MonadClient m => MonadClient (L.StateT s m) where
liftClient = lift . liftClient
-#if MIN_VERSION_transformers(0,4,0)
instance MonadClient m => MonadClient (ExceptT e m) where
liftClient = lift . liftClient
-#endif
mkPool :: MonadIO m => Logger -> Settings -> m Pool
mkPool g s = liftIO $ do
diff --git a/src/Database/Redis/IO/Connection.hs b/src/Database/Redis/IO/Connection.hs
index 453d1bf..5b25203 100644
--- a/src/Database/Redis/IO/Connection.hs
+++ b/src/Database/Redis/IO/Connection.hs
@@ -36,7 +36,6 @@ import Foreign.C.Types (CInt (..))
import Database.Redis.IO.Settings
import Database.Redis.IO.Types
import Database.Redis.IO.Timeouts (TimeoutManager, withTimeout)
-import Network
import Network.Socket hiding (connect, close, send, recv)
import Network.Socket.ByteString (recv, sendMany)
import System.Logger hiding (Settings, settings, close)
@@ -85,7 +84,7 @@ connect t g m a = bracketOnError mkSock S.close $ \s -> do
familyOf (SockAddrInet _ _ ) = AF_INET
familyOf (SockAddrInet6 _ _ _ _) = AF_INET6
familyOf (SockAddrUnix _ ) = AF_UNIX
-#if MIN_VERSION_network(2,6,1)
+#if !MIN_VERSION_network(3,0,0)
familyOf (SockAddrCan _ ) = AF_CAN
#endif
diff --git a/src/Database/Redis/IO/Types.hs b/src/Database/Redis/IO/Types.hs
index 09dff71..c2bf7c5 100644
--- a/src/Database/Redis/IO/Types.hs
+++ b/src/Database/Redis/IO/Types.hs
@@ -30,7 +30,7 @@ instance Show InetAddr where
let i = fromIntegral p :: Int in
shows (fromHostAddress6 a) . showString ":" . shows i $ ""
show (InetAddr (SockAddrUnix unix)) = unix
-#if MIN_VERSION_network(2,6,1)
+#if !MIN_VERSION_network(3,0,0)
show (InetAddr (SockAddrCan int32)) = show int32
#endif
@@ -42,7 +42,7 @@ instance ToBytes InetAddr where
let i = fromIntegral p :: Int in
show (fromHostAddress6 a) +++ val ":" +++ i
bytes (InetAddr (SockAddrUnix unix)) = bytes unix
-#if MIN_VERSION_network(2,6,1)
+#if !MIN_VERSION_network(3,0,0)
bytes (InetAddr (SockAddrCan int32)) = bytes int32
#endif
diff --git a/test/CommandTests.hs b/test/CommandTests.hs
index 2274e49..3d88fa1 100644
--- a/test/CommandTests.hs
+++ b/test/CommandTests.hs
@@ -14,7 +14,7 @@ import Control.Monad (void)
import Control.Monad.IO.Class
import Data.ByteString.Conversion
import Data.ByteString.Lazy (ByteString)
-import Data.Monoid
+import Data.Semigroup ((<>))
import Database.Redis.IO
import Test.Tasty
import Test.Tasty.HUnit