on master help sign in
Bump mrkkrp/ormolu-action from 9 to 10
4ec1f7bdependabot[bot]
.github/workflows/ci.yaml+1−1
@@ -12,7 +12,7 @@ jobs:
12 runs-on: ubuntu-latest
12 runs-on: ubuntu-latest
13 steps:
13 steps:
14 - uses: actions/checkout@v3
14 - uses: actions/checkout@v3
15− - uses: mrkkrp/ormolu-action@v9
15+ - uses: mrkkrp/ormolu-action@v10
16 build:
16 build:
17 runs-on: ubuntu-latest
17 runs-on: ubuntu-latest
18 needs: ormolu
18 needs: ormolu
Network/HTTP/Req.hs+28−28
@@ -498,7 +498,7 @@ reqCb method url body responseProxy options adjustRequest =
498--
498--
499-- @since 3.7.0
499-- @since 3.7.0
500reqHandler ::
500reqHandler ::
501− MonadHttp m =>
501+ (MonadHttp m) =>
502 -- | How to get final result from a 'L.Response'
502 -- | How to get final result from a 'L.Response'
503 (L.Response L.BodyReader -> IO b) ->
503 (L.Response L.BodyReader -> IO b) ->
504 -- | 'L.Request' to perform
504 -- | 'L.Request' to perform
@@ -596,7 +596,7 @@ req' method url body options m = do
596-- | Perform an action using the global implicit 'L.Manager' that the rest
596-- | Perform an action using the global implicit 'L.Manager' that the rest
597-- of the library uses. This allows to reuse connections that the
597-- of the library uses. This allows to reuse connections that the
598-- 'L.Manager' controls.
598-- 'L.Manager' controls.
599−withReqManager :: MonadIO m => (L.Manager -> m a) -> m a
599+withReqManager :: (MonadIO m) => (L.Manager -> m a) -> m a
600withReqManager m = liftIO (readIORef globalManager) >>= m
600withReqManager m = liftIO (readIORef globalManager) >>= m
601
601
602-- | The global 'L.Manager' that 'req' uses. Here we just go with the
602-- | The global 'L.Manager' that 'req' uses. Here we just go with the
@@ -639,7 +639,7 @@ globalManager = unsafePerformIO $ do
639-- | A type class for monads that support performing HTTP requests.
639-- | A type class for monads that support performing HTTP requests.
640-- Typically, you only need to define the 'handleHttpException' method
640-- Typically, you only need to define the 'handleHttpException' method
641-- unless you want to tweak 'HttpConfig'.
641-- unless you want to tweak 'HttpConfig'.
642−class MonadIO m => MonadHttp m where
642+class (MonadIO m) => MonadHttp m where
643 -- | This method describes how to deal with 'HttpException' that was
643 -- | This method describes how to deal with 'HttpException' that was
644 -- caught by the library. One option is to re-throw it if you are OK with
644 -- caught by the library. One option is to re-throw it if you are OK with
645 -- exceptions, but if you prefer working with something like
645 -- exceptions, but if you prefer working with something like
@@ -723,7 +723,7 @@ data HttpConfig = HttpConfig
723 -- | Max length of preview fragment of response body.
723 -- | Max length of preview fragment of response body.
724 --
724 --
725 -- @since 3.6.0
725 -- @since 3.6.0
726− httpConfigBodyPreviewLength :: forall a. Num a => a
726+ httpConfigBodyPreviewLength :: forall a. (Num a) => a
727 }
727 }
728 deriving (Typeable)
728 deriving (Typeable)
729
729
@@ -813,27 +813,27 @@ instance (MonadHttp m, Monoid w) => MonadHttp (AccumT w m) where
813 getHttpConfig = lift getHttpConfig
813 getHttpConfig = lift getHttpConfig
814
814
815-- | @since 3.10.0
815-- | @since 3.10.0
816−instance MonadHttp m => MonadHttp (ContT r m) where
816+instance (MonadHttp m) => MonadHttp (ContT r m) where
817 handleHttpException = lift . handleHttpException
817 handleHttpException = lift . handleHttpException
818 getHttpConfig = lift getHttpConfig
818 getHttpConfig = lift getHttpConfig
819
819
820-- | @since 3.10.0
820-- | @since 3.10.0
821−instance MonadHttp m => MonadHttp (ExceptT e m) where
821+instance (MonadHttp m) => MonadHttp (ExceptT e m) where
822 handleHttpException = lift . handleHttpException
822 handleHttpException = lift . handleHttpException
823 getHttpConfig = lift getHttpConfig
823 getHttpConfig = lift getHttpConfig
824
824
825-- | @since 3.10.0
825-- | @since 3.10.0
826−instance MonadHttp m => MonadHttp (IdentityT m) where
826+instance (MonadHttp m) => MonadHttp (IdentityT m) where
827 handleHttpException = lift . handleHttpException
827 handleHttpException = lift . handleHttpException
828 getHttpConfig = lift getHttpConfig
828 getHttpConfig = lift getHttpConfig
829
829
830-- | @since 3.10.0
830-- | @since 3.10.0
831−instance MonadHttp m => MonadHttp (MaybeT m) where
831+instance (MonadHttp m) => MonadHttp (MaybeT m) where
832 handleHttpException = lift . handleHttpException
832 handleHttpException = lift . handleHttpException
833 getHttpConfig = lift getHttpConfig
833 getHttpConfig = lift getHttpConfig
834
834
835-- | @since 3.10.0
835-- | @since 3.10.0
836−instance MonadHttp m => MonadHttp (ReaderT r m) where
836+instance (MonadHttp m) => MonadHttp (ReaderT r m) where
837 handleHttpException = lift . handleHttpException
837 handleHttpException = lift . handleHttpException
838 getHttpConfig = lift getHttpConfig
838 getHttpConfig = lift getHttpConfig
839
839
@@ -853,17 +853,17 @@ instance (MonadHttp m, Monoid w) => MonadHttp (RWS.Strict.RWST r w s m) where
853 getHttpConfig = lift getHttpConfig
853 getHttpConfig = lift getHttpConfig
854
854
855-- | @since 3.10.0
855-- | @since 3.10.0
856−instance MonadHttp m => MonadHttp (SelectT r m) where
856+instance (MonadHttp m) => MonadHttp (SelectT r m) where
857 handleHttpException = lift . handleHttpException
857 handleHttpException = lift . handleHttpException
858 getHttpConfig = lift getHttpConfig
858 getHttpConfig = lift getHttpConfig
859
859
860-- | @since 3.10.0
860-- | @since 3.10.0
861−instance MonadHttp m => MonadHttp (State.Lazy.StateT s m) where
861+instance (MonadHttp m) => MonadHttp (State.Lazy.StateT s m) where
862 handleHttpException = lift . handleHttpException
862 handleHttpException = lift . handleHttpException
863 getHttpConfig = lift getHttpConfig
863 getHttpConfig = lift getHttpConfig
864
864
865-- | @since 3.10.0
865-- | @since 3.10.0
866−instance MonadHttp m => MonadHttp (State.Strict.StateT s m) where
866+instance (MonadHttp m) => MonadHttp (State.Strict.StateT s m) where
867 handleHttpException = lift . handleHttpException
867 handleHttpException = lift . handleHttpException
868 getHttpConfig = lift getHttpConfig
868 getHttpConfig = lift getHttpConfig
869
869
@@ -887,7 +887,7 @@ instance (MonadHttp m, Monoid w) => MonadHttp (Writer.Strict.WriterT w m) where
887--
887--
888-- @since 0.4.0
888-- @since 0.4.0
889runReq ::
889runReq ::
890− MonadIO m =>
890+ (MonadIO m) =>
891 -- | 'HttpConfig' to use
891 -- | 'HttpConfig' to use
892 HttpConfig ->
892 HttpConfig ->
893 -- | Computation to run
893 -- | Computation to run
@@ -992,7 +992,7 @@ class HttpMethod a where
992 -- | Return name of the method as a 'ByteString'.
992 -- | Return name of the method as a 'ByteString'.
993 httpMethodName :: Proxy a -> ByteString
993 httpMethodName :: Proxy a -> ByteString
994
994
995−instance HttpMethod method => RequestComponent (Tagged "method" method) where
995+instance (HttpMethod method) => RequestComponent (Tagged "method" method) where
996 getRequestMod _ = Endo $ \x ->
996 getRequestMod _ = Endo $ \x ->
997 x {L.method = httpMethodName (Proxy :: Proxy method)}
997 x {L.method = httpMethodName (Proxy :: Proxy method)}
998
998
@@ -1040,7 +1040,7 @@ type role Url nominal
1040
1040
1041-- With template-haskell >=2.15 and text >=1.2.4 Lift can be derived, however
1041-- With template-haskell >=2.15 and text >=1.2.4 Lift can be derived, however
1042-- the derived lift forgets the type of the scheme.
1042-- the derived lift forgets the type of the scheme.
1043−instance Typeable scheme => TH.Lift (Url scheme) where
1043+instance (Typeable scheme) => TH.Lift (Url scheme) where
1044 lift url =
1044 lift url =
1045 TH.dataToExpQ (fmap liftText . cast) url `TH.sigE` case url of
1045 TH.dataToExpQ (fmap liftText . cast) url `TH.sigE` case url of
1046 Url Http _ -> [t|Url 'Http|]
1046 Url Http _ -> [t|Url 'Http|]
@@ -1063,7 +1063,7 @@ https = Url Https . pure
1063-- path segment can be of any type that is an instance of 'ToHttpApiData'.
1063-- path segment can be of any type that is an instance of 'ToHttpApiData'.
1064infixl 5 /~
1064infixl 5 /~
1065
1065
1066−(/~) :: ToHttpApiData a => Url scheme -> a -> Url scheme
1066+(/~) :: (ToHttpApiData a) => Url scheme -> a -> Url scheme
1067Url secure path /~ segment = Url secure (NE.cons (toUrlPiece segment) path)
1067Url secure path /~ segment = Url secure (NE.cons (toUrlPiece segment) path)
1068
1068
1069-- | A type-constrained version of @('/~')@ to remove ambiguity in the cases
1069-- | A type-constrained version of @('/~')@ to remove ambiguity in the cases
@@ -1251,7 +1251,7 @@ instance HttpBody NoReqBody where
1251-- charset=utf-8\"@ value.
1251-- charset=utf-8\"@ value.
1252newtype ReqBodyJson a = ReqBodyJson a
1252newtype ReqBodyJson a = ReqBodyJson a
1253
1253
1254−instance ToJSON a => HttpBody (ReqBodyJson a) where
1254+instance (ToJSON a) => HttpBody (ReqBodyJson a) where
1255 getRequestBody (ReqBodyJson a) = L.RequestBodyLBS (A.encode a)
1255 getRequestBody (ReqBodyJson a) = L.RequestBodyLBS (A.encode a)
1256 getRequestContentType _ = pure "application/json; charset=utf-8"
1256 getRequestContentType _ = pure "application/json; charset=utf-8"
1257
1257
@@ -1350,7 +1350,7 @@ instance HttpBody ReqBodyMultipart where
1350-- | Create 'ReqBodyMultipart' request body from a collection of 'LM.Part's.
1350-- | Create 'ReqBodyMultipart' request body from a collection of 'LM.Part's.
1351--
1351--
1352-- @since 0.2.0
1352-- @since 0.2.0
1353−reqBodyMultipart :: MonadIO m => [LM.Part] -> m ReqBodyMultipart
1353+reqBodyMultipart :: (MonadIO m) => [LM.Part] -> m ReqBodyMultipart
1354reqBodyMultipart parts = liftIO $ do
1354reqBodyMultipart parts = liftIO $ do
1355 boundary <- LM.webkitBoundary
1355 boundary <- LM.webkitBoundary
1356 body <- LM.renderParts boundary parts
1356 body <- LM.renderParts boundary parts
@@ -1390,7 +1390,7 @@ type family
1390 TypeError
1390 TypeError
1391 ('Text "This HTTP method does not allow attaching a request body.")
1391 ('Text "This HTTP method does not allow attaching a request body.")
1392
1392
1393−instance HttpBody body => RequestComponent (Tagged "body" body) where
1393+instance (HttpBody body) => RequestComponent (Tagged "body" body) where
1394 getRequestMod (Tagged body) = Endo $ \x ->
1394 getRequestMod (Tagged body) = Endo $ \x ->
1395 x
1395 x
1396 { L.requestBody = getRequestBody body,
1396 { L.requestBody = getRequestBody body,
@@ -1460,7 +1460,7 @@ instance RequestComponent (Option scheme) where
1460
1460
1461-- | Finalize given 'L.Request' by applying a finalizer from the given
1461-- | Finalize given 'L.Request' by applying a finalizer from the given
1462-- 'Option' (if it has any).
1462-- 'Option' (if it has any).
1463−finalizeRequest :: MonadIO m => Option scheme -> L.Request -> m L.Request
1463+finalizeRequest :: (MonadIO m) => Option scheme -> L.Request -> m L.Request
1464finalizeRequest (Option _ mfinalizer) = liftIO . fromMaybe pure mfinalizer
1464finalizeRequest (Option _ mfinalizer) = liftIO . fromMaybe pure mfinalizer
1465
1465
1466----------------------------------------------------------------------------
1466----------------------------------------------------------------------------
@@ -1493,7 +1493,7 @@ name =: value = queryParam name (pure value)
1493-- This operator is defined in terms of 'queryParam':
1493-- This operator is defined in terms of 'queryParam':
1494--
1494--
1495-- > queryFlag name = queryParam name (Nothing :: Maybe ())
1495-- > queryFlag name = queryParam name (Nothing :: Maybe ())
1496−queryFlag :: QueryParam param => Text -> param
1496+queryFlag :: (QueryParam param) => Text -> param
1497queryFlag name = queryParam name (Nothing :: Maybe ())
1497queryFlag name = queryParam name (Nothing :: Maybe ())
1498
1498
1499-- | Construct query parameters from a 'ToForm' instance. This function
1499-- | Construct query parameters from a 'ToForm' instance. This function
@@ -1523,7 +1523,7 @@ class QueryParam param where
1523 -- 'Nothing', it won't be included at all (i.e. you create a flag this
1523 -- 'Nothing', it won't be included at all (i.e. you create a flag this
1524 -- way). It's recommended to use @('=:')@ and 'queryFlag' instead of this
1524 -- way). It's recommended to use @('=:')@ and 'queryFlag' instead of this
1525 -- method, because they are easier to read.
1525 -- method, because they are easier to read.
1526− queryParam :: ToHttpApiData a => Text -> Maybe a -> param
1526+ queryParam :: (ToHttpApiData a) => Text -> Maybe a -> param
1527
1527
1528 -- | Get the query parameter names and values set by 'queryParam'.
1528 -- | Get the query parameter names and values set by 'queryParam'.
1529 --
1529 --
@@ -1772,7 +1772,7 @@ ignoreResponse = Proxy
1772newtype JsonResponse a = JsonResponse (L.Response a)
1772newtype JsonResponse a = JsonResponse (L.Response a)
1773 deriving (Show)
1773 deriving (Show)
1774
1774
1775−instance FromJSON a => HttpResponse (JsonResponse a) where
1775+instance (FromJSON a) => HttpResponse (JsonResponse a) where
1776 type HttpResponseBody (JsonResponse a) = a
1776 type HttpResponseBody (JsonResponse a) = a
1777 toVanillaResponse (JsonResponse r) = r
1777 toVanillaResponse (JsonResponse r) = r
1778 getHttpResponse r = do
1778 getHttpResponse r = do
@@ -1888,14 +1888,14 @@ brReadN br n = go 0 id id
1888
1888
1889-- | Get the response body.
1889-- | Get the response body.
1890responseBody ::
1890responseBody ::
1891− HttpResponse response =>
1891+ (HttpResponse response) =>
1892 response ->
1892 response ->
1893 HttpResponseBody response
1893 HttpResponseBody response
1894responseBody = L.responseBody . toVanillaResponse
1894responseBody = L.responseBody . toVanillaResponse
1895
1895
1896-- | Get the response status code.
1896-- | Get the response status code.
1897responseStatusCode ::
1897responseStatusCode ::
1898− HttpResponse response =>
1898+ (HttpResponse response) =>
1899 response ->
1899 response ->
1900 Int
1900 Int
1901responseStatusCode =
1901responseStatusCode =
@@ -1903,7 +1903,7 @@ responseStatusCode =
1903
1903
1904-- | Get the response status message.
1904-- | Get the response status message.
1905responseStatusMessage ::
1905responseStatusMessage ::
1906− HttpResponse response =>
1906+ (HttpResponse response) =>
1907 response ->
1907 response ->
1908 ByteString
1908 ByteString
1909responseStatusMessage =
1909responseStatusMessage =
@@ -1911,7 +1911,7 @@ responseStatusMessage =
1911
1911
1912-- | Lookup a particular header from a response.
1912-- | Lookup a particular header from a response.
1913responseHeader ::
1913responseHeader ::
1914− HttpResponse response =>
1914+ (HttpResponse response) =>
1915 -- | Response interpretation
1915 -- | Response interpretation
1916 response ->
1916 response ->
1917 -- | Header to lookup
1917 -- | Header to lookup
@@ -1923,7 +1923,7 @@ responseHeader r h =
1923
1923
1924-- | Get the response 'L.CookieJar'.
1924-- | Get the response 'L.CookieJar'.
1925responseCookieJar ::
1925responseCookieJar ::
1926− HttpResponse response =>
1926+ (HttpResponse response) =>
1927 response ->
1927 response ->
1928 L.CookieJar
1928 L.CookieJar
1929responseCookieJar = L.responseCookieJar . toVanillaResponse
1929responseCookieJar = L.responseCookieJar . toVanillaResponse
httpbin-tests/Network/HTTP/ReqSpec.hs+1−1
@@ -471,7 +471,7 @@ emptyObject :: Value
471emptyObject = Object Aeson.KeyMap.empty
471emptyObject = Object Aeson.KeyMap.empty
472
472
473-- | Get a rendered JSON value as 'Text'.
473-- | Get a rendered JSON value as 'Text'.
474−reflectJSON :: ToJSON a => a -> Text
474+reflectJSON :: (ToJSON a) => a -> Text
475reflectJSON = T.decodeUtf8 . BL.toStrict . A.encode
475reflectJSON = T.decodeUtf8 . BL.toStrict . A.encode
476
476
477-- | Clarify to the type checker that the inner computation is in the 'IO'
477-- | Clarify to the type checker that the inner computation is in the 'IO'
pure-tests/Network/HTTP/ReqSpec.hs+1−1
@@ -413,7 +413,7 @@ spec = do
413 -- 'Https, Option _) type checks, so we can catch if the type of scheme
413 -- 'Https, Option _) type checks, so we can catch if the type of scheme
414 -- is unspecified.
414 -- is unspecified.
415 let testTypeOfQuoterResult ::
415 let testTypeOfQuoterResult ::
416− forall a s. Typeable a => (a, Option s) -> Bool
416+ forall a s. (Typeable a) => (a, Option s) -> Bool
417 testTypeOfQuoterResult _ = isJust $ eqT @a @(Url 'Https)
417 testTypeOfQuoterResult _ = isJust $ eqT @a @(Url 'Https)
418 in property $ testTypeOfQuoterResult [urlQ|https://example.org/|]
418 in property $ testTypeOfQuoterResult [urlQ|https://example.org/|]
419 it "doesn't work for invalid urls" $
419 it "doesn't work for invalid urls" $