diff --git a/.gitignore b/.gitignore index 477a353..fd75f42 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ cabal-dev *.chi *.chs.h .virthualenv +.stack-work diff --git a/hedis-simple.cabal b/hedis-simple.cabal index 67d597a..d093e07 100644 --- a/hedis-simple.cabal +++ b/hedis-simple.cabal @@ -1,5 +1,5 @@ name: hedis-simple -version: 0.1.0.0 +version: 0.1.1.0 synopsis: A simplified API for hedis description: hedis-simple wraps most hedis commands in an EitherT monad to simplify a lot of the verbose error checking that one would normally have to perform. homepage: http://github.com/sanetracker/hedis-simple @@ -18,5 +18,9 @@ source-repository head library exposed-modules: Database.Redis.Simple - build-depends: base ==4.6.*, mtl ==2.1.*, either ==3.4.*, bytestring ==0.10.*, hedis ==0.6.* + build-depends: base >= 4.7 && < 5 + , mtl >= 2.1 + , either >= 3.4 + , bytestring >= 0.10 + , hedis == 0.6.* hs-source-dirs: src diff --git a/src/Database/Redis/Simple.hs b/src/Database/Redis/Simple.hs index a470c3c..f8b3397 100644 --- a/src/Database/Redis/Simple.hs +++ b/src/Database/Redis/Simple.hs @@ -173,6 +173,7 @@ module Database.Redis.Simple ( import Control.Applicative import Control.Monad.Trans import Control.Monad.Trans.Either +import Control.Monad.Error.Class import Data.ByteString (ByteString) import qualified Database.Redis as R @@ -181,7 +182,7 @@ class WrappedRedis m mi r | m -> mi r where unwrap :: m a -> mi (r a) newtype Redis a = Redis { fromRedis :: EitherT R.Reply R.Redis a } - deriving (Functor, Applicative, Monad, MonadIO) + deriving (Functor, Applicative, Monad, MonadIO, MonadError R.Reply) newtype RedisTx a = RedisTx { fromRedisTx :: R.RedisTx (R.Queued a) } diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..5d330fc --- /dev/null +++ b/stack.yaml @@ -0,0 +1,32 @@ +# For more information, see: https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md + +# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) +resolver: lts-3.11 + +# Local packages, usually specified by relative directory name +packages: +- '.' + +# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) +extra-deps: [] + +# Override default flag values for local packages and extra-deps +flags: {} + +# Extra package databases containing global packages +extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true + +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: >= 0.1.4.0 + +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 + +# Extra directories used by stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir]