packages feed

polysemy-http 0.4.0.3 → 0.4.0.4

raw patch · 5 files changed

+15/−8 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Polysemy.Http.Data.Request: body :: HasRequest c_aBL2 => Lens' c_aBL2 Body
+ Polysemy.Http.Data.Request: body :: HasRequest c_aBzp => Lens' c_aBzp Body
- Polysemy.Http.Data.Request: class HasRequest c_aBL2
+ Polysemy.Http.Data.Request: class HasRequest c_aBzp
- Polysemy.Http.Data.Request: cookies :: HasRequest c_aBL2 => Lens' c_aBL2 CookieJar
+ Polysemy.Http.Data.Request: cookies :: HasRequest c_aBzp => Lens' c_aBzp CookieJar
- Polysemy.Http.Data.Request: headers :: HasRequest c_aBL2 => Lens' c_aBL2 [(HeaderName, HeaderValue)]
+ Polysemy.Http.Data.Request: headers :: HasRequest c_aBzp => Lens' c_aBzp [(HeaderName, HeaderValue)]
- Polysemy.Http.Data.Request: host :: HasRequest c_aBL2 => Lens' c_aBL2 Host
+ Polysemy.Http.Data.Request: host :: HasRequest c_aBzp => Lens' c_aBzp Host
- Polysemy.Http.Data.Request: method :: HasRequest c_aBL2 => Lens' c_aBL2 Method
+ Polysemy.Http.Data.Request: method :: HasRequest c_aBzp => Lens' c_aBzp Method
- Polysemy.Http.Data.Request: path :: HasRequest c_aBL2 => Lens' c_aBL2 Path
+ Polysemy.Http.Data.Request: path :: HasRequest c_aBzp => Lens' c_aBzp Path
- Polysemy.Http.Data.Request: port :: HasRequest c_aBL2 => Lens' c_aBL2 (Maybe Port)
+ Polysemy.Http.Data.Request: port :: HasRequest c_aBzp => Lens' c_aBzp (Maybe Port)
- Polysemy.Http.Data.Request: query :: HasRequest c_aBL2 => Lens' c_aBL2 [(QueryKey, Maybe QueryValue)]
+ Polysemy.Http.Data.Request: query :: HasRequest c_aBzp => Lens' c_aBzp [(QueryKey, Maybe QueryValue)]
- Polysemy.Http.Data.Request: request :: HasRequest c_aBL2 => Lens' c_aBL2 Request
+ Polysemy.Http.Data.Request: request :: HasRequest c_aBzp => Lens' c_aBzp Request
- Polysemy.Http.Data.Request: tls :: HasRequest c_aBL2 => Lens' c_aBL2 Tls
+ Polysemy.Http.Data.Request: tls :: HasRequest c_aBzp => Lens' c_aBzp Tls
- Polysemy.Http.Manager: interpretManagerWith :: Member (Embed IO) r => Manager -> InterpreterFor Manager r
+ Polysemy.Http.Manager: interpretManagerWith :: Manager -> InterpreterFor Manager r

Files

lib/Polysemy/Http/Data/Request.hs view
@@ -128,6 +128,10 @@     _query :: [(QueryKey, Maybe QueryValue)],     _body :: Body   }-  deriving (Eq, Show, Generic)+  deriving (Show, Generic)  makeClassy ''Request++instance Eq Request where+  Request lm lh lp lt lpa lhe _ lq lb == Request rm rh rp rt rpa rhe _ rq rb =+    lm == rm && lh == rh && lp == rp && lt == rt && lpa == rpa && lhe == rhe && lq == rq && lb == rb
lib/Polysemy/Http/Data/Response.hs view
@@ -5,14 +5,14 @@  import Network.HTTP.Client (BodyReader, CookieJar) import Network.HTTP.Types (-  Status(Status),+  Status (Status),   statusIsClientError,   statusIsInformational,   statusIsRedirection,   statusIsServerError,   statusIsSuccessful,   )-import qualified Text.Show as Text (Show(show))+import qualified Text.Show as Text (Show (show))  import Polysemy.Http.Data.Header (Header) @@ -28,11 +28,15 @@     -- |The native cookie jar.     _cookies :: CookieJar   }-  deriving (Eq, Show)+  deriving (Show)  instance {-# overlapping #-} Show (Response BodyReader) where   show (Response s _ hs _) =     [qt|StreamingResponse { status :: #{s}, headers :: #{hs} }|]++instance Eq b => Eq (Response b) where+  Response ls lb lh _ == Response rs rb rh _ =+    ls == rs && lb == rb && lh == rh  -- |Match on a response with a 1xx status. pattern Info ::
lib/Polysemy/Http/Manager.hs view
@@ -7,7 +7,6 @@ import Polysemy.Http.Data.Manager (Manager(..))  interpretManagerWith ::-  Member (Embed IO) r =>   HTTP.Manager ->   InterpreterFor Manager r interpretManagerWith manager = do
lib/Polysemy/Http/Native.hs view
@@ -118,7 +118,7 @@ interpretHttpNativeWith =   interpretH \case     Http.Response request f -> do-      distribEither =<< withResponse request (runTSimple . f)+      distribEither =<< withResponse request ((\x -> runTSimple x) . f)     Http.Request request -> do       Log.debug [qt|http request: #{request}|]       manager <- Manager.get@@ -127,7 +127,7 @@         response <$ Log.debug [qt|http response: #{response}|]     Http.Stream request handler -> do       Log.debug [qt|http stream request: #{request}|]-      distribEither =<< withResponse request (runTSimple . handler)+      distribEither =<< withResponse request ((\x -> runTSimple x). handler)     Http.ConsumeChunk body ->       pureT . first HttpError.ChunkFailed =<< tryAny body {-# INLINE interpretHttpNativeWith #-}
polysemy-http.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           polysemy-http-version:        0.4.0.3+version:        0.4.0.4 synopsis:       Polysemy effect for http-client description:    See <https://hackage.haskell.org/package/polysemy-http/docs/Polysemy-Http.html> category:       Network