req 3.9.2 → 3.10.0
raw patch · 3 files changed
+107/−14 lines, 3 filesdep ~template-haskelldep ~textdep ~transformers
Dependency ranges changed: template-haskell, text, transformers
Files
- CHANGELOG.md +4/−0
- Network/HTTP/Req.hs +89/−0
- req.cabal +14/−14
CHANGELOG.md view
@@ -1,3 +1,7 @@+## Req 3.10.0++* Add `MonadHttp` instances for `transformers` types.+ ## Req 3.9.2 * The test suite works with `aeson-2.x.x.x`.
Network/HTTP/Req.hs view
@@ -220,7 +220,21 @@ import Control.Monad.IO.Class import Control.Monad.IO.Unlift import Control.Monad.Reader+import Control.Monad.Trans.Accum (AccumT)+import Control.Monad.Trans.Cont (ContT) import Control.Monad.Trans.Control+import Control.Monad.Trans.Except (ExceptT)+import Control.Monad.Trans.Identity (IdentityT)+import Control.Monad.Trans.Maybe (MaybeT)+import qualified Control.Monad.Trans.RWS.CPS as RWS.CPS+import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy+import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict+import Control.Monad.Trans.Select (SelectT)+import qualified Control.Monad.Trans.State.Lazy as State.Lazy+import qualified Control.Monad.Trans.State.Strict as State.Strict+import qualified Control.Monad.Trans.Writer.CPS as Writer.CPS+import qualified Control.Monad.Trans.Writer.Lazy as Writer.Lazy+import qualified Control.Monad.Trans.Writer.Strict as Writer.Strict import Control.Retry import Data.Aeson (FromJSON (..), ToJSON (..)) import qualified Data.Aeson as A@@ -786,6 +800,81 @@ instance MonadHttp Req where handleHttpException = Req . lift . throwIO getHttpConfig = Req ask++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (AccumT w m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (ContT r m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (ExceptT e m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (IdentityT m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (MaybeT m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (ReaderT r m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (RWS.CPS.RWST r w s m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (RWS.Lazy.RWST r w s m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (RWS.Strict.RWST r w s m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (SelectT r m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (State.Lazy.StateT s m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance MonadHttp m => MonadHttp (State.Strict.StateT s m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (Writer.CPS.WriterT w m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (Writer.Lazy.WriterT w m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig++-- | @since 3.10.0+instance (MonadHttp m, Monoid w) => MonadHttp (Writer.Strict.WriterT w m) where+ handleHttpException = lift . handleHttpException+ getHttpConfig = lift getHttpConfig -- | Run a computation in the 'Req' monad with the given 'HttpConfig'. In -- the case of an exceptional situation an 'HttpException' will be thrown.
req.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: req-version: 3.9.2+version: 3.10.0 license: BSD3 license-file: LICENSE.md maintainer: Mark Karpov <markkarpov92@gmail.com>@@ -52,7 +52,7 @@ template-haskell >=2.14 && <2.18, text >=0.2 && <1.3, time >=1.2 && <1.13,- transformers >=0.4 && <0.6,+ transformers >=0.5.3.0 && <0.6, transformers-base, unliftio-core >=0.1.1 && <0.3 @@ -68,12 +68,12 @@ -Wnoncanonical-monad-instances test-suite pure-tests- type: exitcode-stdio-1.0- main-is: Spec.hs- build-tools: hspec-discover >=2.0 && <3.0- hs-source-dirs: pure-tests- other-modules: Network.HTTP.ReqSpec- default-language: Haskell2010+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ build-tool-depends: hspec-discover:hspec-discover >=2.0 && <3.0+ hs-source-dirs: pure-tests+ other-modules: Network.HTTP.ReqSpec+ default-language: Haskell2010 build-depends: QuickCheck >=2.7 && <3.0, aeson >=0.9 && <3,@@ -100,12 +100,12 @@ ghc-options: -O2 -Wall test-suite httpbin-tests- type: exitcode-stdio-1.0- main-is: Spec.hs- build-tools: hspec-discover >=2.0 && <3.0- hs-source-dirs: httpbin-tests- other-modules: Network.HTTP.ReqSpec- default-language: Haskell2010+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ build-tool-depends: hspec-discover:hspec-discover >=2.0 && <3.0+ hs-source-dirs: httpbin-tests+ other-modules: Network.HTTP.ReqSpec+ default-language: Haskell2010 build-depends: QuickCheck >=2.7 && <3.0, aeson >=2 && <3,