Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cache:

matrix:
include:
- ghc: 8.8.1
- ghc: 8.6.5
- ghc: 8.4.4
- ghc: 8.2.2
- ghc: 9.8.2
- ghc: 9.6.6
- ghc: 9.4.8
- ghc: 9.2.8

install:
- |
Expand Down
7 changes: 3 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
packages:
./
hreq-client/
hreq-core/
hreq-conduit/
./hreq-client/
./hreq-core/
./hreq-conduit/
62 changes: 31 additions & 31 deletions hreq-client/hreq-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ license: MIT
license-file: LICENSE.md
extra-doc-files: CHANGELOG.md, README.md
tested-with:
GHC ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.1
GHC ==9.2.8
|| ==9.4.8
|| ==9.6.6
|| ==9.8.2
build-type: Custom

source-repository head
Expand All @@ -38,23 +38,23 @@ library
default-extensions: LambdaCase DeriveGeneric FlexibleInstances FlexibleContexts ScopedTypeVariables TypeApplications TypeOperators MultiParamTypeClasses RecordWildCards TypeApplications TypeFamilies OverloadedStrings GADTs GeneralizedNewtypeDeriving FunctionalDependencies ConstraintKinds RankNTypes PolyKinds DataKinds KindSignatures ViewPatterns UndecidableInstances StrictData

build-depends:
base >= 4.10.1 && < 5,
base-compat >= 0.10.5 && < 0.13,
bytestring >= 0.10.8 && < 0.11,
containers >= 0.5.7.1 && < 0.7,
exceptions >= 0.10.0 && < 0.11,
http-client >= 0.6.4 && < 0.7,
http-client-tls >= 0.3.5 && < 0.4,
hreq-core >= 0.1.1,
http-media >= 0.8.0 && < 0.9,
http-types >= 0.12.3 && < 0.13,
mtl >= 2.2.2 && < 3.0,
retry >= 0.8 && < 0.9,
time >= 1.6.0.1 && < 2.0,
text >= 1.2.4 && < 1.3,
stm >= 2.4.5.1 && < 2.6,
unliftio-core >= 0.1.2 && < 0.2.0,
string-conversions >= 0.4.0 && < 0.5
base >= 4.14 && < 5,
base-compat >= 0.10.5 && < 0.15,
bytestring >= 0.10.8 && < 0.13,
containers >= 0.5.7.1 && < 0.8,
exceptions >= 0.10.0 && < 0.11,
http-client >= 0.6.4 && < 0.8,
http-client-tls >= 0.3.5 && < 0.4,
hreq-core >= 0.1.1,
http-media >= 0.8.0 && < 0.9,
http-types >= 0.12.3 && < 0.13,
mtl >= 2.2.2 && < 3.0,
retry >= 0.8 && < 0.9,
time >= 1.6.0.1 && < 2.0,
text >= 1.2.4 && < 2.2,
stm >= 2.4.5.1 && < 2.6,
unliftio-core ^>= 0.2,
string-conversions >= 0.4.0 && < 0.5

ghc-options:
-Wall
Expand All @@ -78,16 +78,16 @@ executable example
build-depends:
base >= 4.10.1 && < 5
, hreq-client
, aeson >= 1.4.5 && < 1.5
, text >= 1.2.4 && < 1.3
, aeson >= 1.4.5 && < 1.6 || >= 2.2 && < 2.3
, text >= 1.2.4 && < 1.3 || >= 2.0 && < 2.2

test-suite spec
build-depends:
base >= 4.10.1 && < 5
, aeson >= 1.4.5 && < 1.5
, containers >= 0.5.7.1 && < 0.7
, http-types >= 0.12.3 && < 0.13
, hspec >= 2.6.0 && < 2.8
base >= 4.10.1 && < 5
, aeson >= 1.4.5 && < 1.6 || >= 2.2 && < 2.3
, containers >= 0.5.7.1 && < 0.8
, http-types >= 0.12.3 && < 0.13
, hspec >= 2.6.0 && < 2.8
, hreq-client
, hreq-core
main-is: Spec.hs
Expand All @@ -109,9 +109,9 @@ test-suite doctests
type: exitcode-stdio-1.0
main-is: DocTests.hs
build-depends:
base >= 4.10.1 && < 5
, aeson >= 1.4.5 && < 1.5
, doctest >=0.15 && < 0.17
base >= 4.14 && < 5
, aeson >= 1.4.5 && < 1.6 || >= 2.2 && < 2.3
, doctest >= 0.15 && < 0.23
, hreq-client

ghc-options: -Wall -threaded
Expand Down
46 changes: 23 additions & 23 deletions hreq-conduit/hreq-conduit.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ license: MIT
license-file: LICENSE.md
extra-doc-files: CHANGELOG.md, README.md
tested-with:
GHC ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.1
GHC ==9.2.8
|| ==9.4.8
|| ==9.6.6
|| ==9.8.2
build-type: Custom

custom-setup
Expand All @@ -39,17 +39,17 @@ library
default-extensions: LambdaCase DeriveGeneric FlexibleInstances FlexibleContexts ScopedTypeVariables TypeApplications TypeOperators MultiParamTypeClasses RecordWildCards TypeApplications TypeFamilies OverloadedStrings GADTs GeneralizedNewtypeDeriving FunctionalDependencies ConstraintKinds RankNTypes PolyKinds DataKinds KindSignatures ViewPatterns UndecidableInstances StrictData

build-depends:
base >= 4.10.1 && < 5,
bytestring >= 0.10.8 && < 0.11,
exceptions >= 0.10.0 && < 0.11,
http-client >= 0.6.4 && < 0.7,
http-types >= 0.12.3 && < 0.13,
hreq-client >= 0.1.0,
hreq-core >= 0.1.0,
conduit >=1.3.1 && <1.4,
mtl >= 2.2.2 && < 3.0,
retry >= 0.8 && < 0.9,
unliftio-core >= 0.1.2 && < 0.2.0
base >= 4.14 && < 5,
bytestring >= 0.10.8 && < 0.13,
exceptions >= 0.10.0 && < 0.11,
http-client >= 0.6.4 && < 0.8,
http-types >= 0.12.3 && < 0.13,
hreq-client >= 0.1.0,
hreq-core >= 0.1.0,
conduit >= 1.3.1 && < 1.4,
mtl >= 2.2.2 && < 3.0,
retry >= 0.8 && < 0.9,
unliftio-core ^>= 0.2.0

ghc-options:
-Wall
Expand All @@ -69,12 +69,12 @@ test-suite spec

build-depends:
base >= 4.10.1 && < 5
, conduit >=1.3.1 && <1.4
, conduit >= 1.3.1 && <1.4
, http-types >= 0.12.3 && < 0.13
, hspec >= 2.6.0 && < 2.8
, hreq-conduit
, string-conversions >= 0.4.0 && < 0.5
, text >= 1.2.4 && < 1.3
, text >= 1.2.4 && < 1.3 || >= 2.0 && < 2.2
main-is: Spec.hs
other-modules: Hreq.HttpBin.SuccessSpec
hs-source-dirs: test
Expand All @@ -87,9 +87,9 @@ test-suite spec

test-suite readme
build-depends:
base >= 4.10.1 && < 5
, conduit >=1.3.1 && <1.4
, bytestring >= 0.10.8 && < 0.11
base >= 4.10.1 && < 5
, conduit >= 1.3.1 && < 1.4
, bytestring >= 0.10.8 && < 0.11
, hreq-conduit
, string-conversions >= 0.4.0 && < 0.5
, text >= 1.2.4 && < 1.3
Expand All @@ -104,9 +104,9 @@ test-suite doctests
type: exitcode-stdio-1.0
main-is: DocTests.hs
build-depends:
base >= 4.10.1 && < 5
, aeson >= 1.4.5 && < 1.5
, doctest >=0.15 && < 0.17
base >= 4.14 && < 5
, aeson >= 1.4.5 && < 1.6 || >= 2.2 && < 2.3
, doctest >= 0.15 && < 0.23
, hreq-conduit

ghc-options: -Wall -threaded
Expand Down
8 changes: 4 additions & 4 deletions hreq-conduit/src/Hreq/Conduit/Internal/HTTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ runStreamingHttp
runStreamingHttp req f = do
config <- ask
let manager = httpManager config
let baseUrl = httpBaseUrl config
let statusRange = httpStatuses config
baseUrl = httpBaseUrl config
statusRange = httpStatuses config

let httpRequest = requestToHTTPRequest baseUrl req
httpRequest = requestToHTTPRequest baseUrl req

let action = liftIO $ catchConnectionError $ HTTP.withResponse httpRequest manager $ \res -> do
action = liftIO $ catchConnectionError $ HTTP.withResponse httpRequest manager $ \res -> do
checkStreamResponse res statusRange
f (ResBodyStream $ bodyReaderSource (HTTP.responseBody res))

Expand Down
39 changes: 20 additions & 19 deletions hreq-core/hreq-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ license: MIT
license-file: LICENSE.md
extra-doc-files: CHANGELOG.md, README.md
tested-with:
GHC ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.1
GHC ==9.2.8
|| ==9.4.8
|| ==9.6.6
|| ==9.8.2
build-type: Custom

source-repository head
Expand Down Expand Up @@ -54,19 +54,20 @@ library

default-extensions: LambdaCase DeriveGeneric FlexibleInstances FlexibleContexts ScopedTypeVariables TypeApplications TypeOperators MultiParamTypeClasses RecordWildCards TypeApplications TypeFamilies OverloadedStrings GADTs GeneralizedNewtypeDeriving FunctionalDependencies ConstraintKinds RankNTypes PolyKinds DataKinds KindSignatures ViewPatterns UndecidableInstances StrictData
build-depends:
base >= 4.10.1 && < 5,
base-compat >= 0.10.5 && < 0.13,
aeson >= 1.4.5 && < 1.5,
attoparsec >= 0.13.2.2 && < 0.14,
bytestring >= 0.10.8 && < 0.11,
containers >= 0.5.7.1 && < 0.7,
exceptions >= 0.10.0 && < 0.11,
http-api-data >= 0.4.1 && < 0.5,
http-media >= 0.8.0 && < 0.9,
http-types >= 0.12.3 && < 0.13,
mtl >= 2.2.2 && < 3.0,
text >= 1.2.4 && < 1.3,
string-conversions >= 0.4.0 && < 0.5
base >= 4.14 && < 5,
base-compat >= 0.10.5 && < 0.13,
aeson >= 1.4.5 && < 1.6 || >= 2.2 && < 2.3,
attoparsec >= 0.13.2.2 && < 0.15,
attoparsec-aeson >= 2.0,
bytestring >= 0.10.8 && < 0.13,
containers >= 0.5.7.1 && < 0.8,
exceptions >= 0.10.0 && < 0.11,
http-api-data >= 0.4.1 && < 0.7,
http-media >= 0.8.0 && < 0.9,
http-types >= 0.12.3 && < 0.13,
mtl >= 2.2.2 && < 3.0,
text >= 1.2.4 && < 2.2,
string-conversions >= 0.4.0 && < 0.5
ghc-options:
-Wall
-Wincomplete-uni-patterns
Expand All @@ -85,8 +86,8 @@ test-suite doctests
type: exitcode-stdio-1.0
main-is: DocTests.hs
build-depends:
base >= 4.10.1 && < 5
, doctest >=0.15 && < 0.17
base >= 4.14 && < 5
, doctest >= 0.15 && < 0.23
, hreq-core

ghc-options: -Wall -threaded
Expand Down
9 changes: 8 additions & 1 deletion hreq-core/src/Data/Singletons.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
===Attribution
Some of the code in this module was directly borrowed from the Singletons library
-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Data.Singletons where

import Data.Kind

#if MIN_VERSION_base(4,18,0)
import GHC.TypeLits hiding (SNat, SSymbol)
#else
import GHC.TypeLits
#endif
import Data.Typeable

-- * Sing Type family
Expand Down
2 changes: 1 addition & 1 deletion hreq-core/src/Hreq/Core/API/Request.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Hreq.Core.API.Request where

import Data.Kind (Type)
import Data.Singletons (Sing, SingI(..))
import Data.Singletons (Sing, SingI (..))
import GHC.TypeLits (Symbol)

-- * Request Type
Expand Down
12 changes: 6 additions & 6 deletions hreq-core/src/Hreq/Core/API/TypeLevel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
--
module Hreq.Core.API.TypeLevel where

import Data.Kind (Type, Constraint)
import GHC.TypeLits (Symbol, TypeError, ErrorMessage(..), KnownSymbol, KnownNat)
import Data.Kind (Constraint, Type)
import GHC.TypeLits (ErrorMessage (..), KnownNat, KnownSymbol, Symbol, TypeError)
import Network.HTTP.Types (Header)
import Web.HttpApiData (ToHttpApiData)

import Hreq.Core.Client.BasicAuth (BasicAuthData)
import Hreq.Core.API.Request (ReqContent(..))
import Hreq.Core.API.Response (ResContent (..))
import Hreq.Core.API.Internal ((:>))
import Hreq.Core.API.MediaType (MediaDecode, MediaEncode, HasMediaType)
import Hreq.Core.API.MediaType (HasMediaType, MediaDecode, MediaEncode)
import Hreq.Core.API.Request (ReqContent (..))
import Hreq.Core.API.Response (ResContent (..))
import Hreq.Core.API.Streaming (HasStreamBody)
import Hreq.Core.API.Verb (Verb)
import Hreq.Core.Client.BasicAuth (BasicAuthData)

-- | 'ApiToReq' transforms an API type into a type level list of
-- Request component content types.
Expand Down
13 changes: 9 additions & 4 deletions hreq-core/src/Hreq/Core/Client/HasRequest.hs
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
-- | This module provides a 'HasRequest' class that Interprets
-- a 'ReqContent' type level list into 'Request' data
--
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternSynonyms #-}
module Hreq.Core.Client.HasRequest where

import Prelude ()
import Prelude.Compat

import Data.Kind
import Data.Hlist
import Data.Kind
import Data.Proxy
import Data.Singletons
#if MIN_VERSION_base(4,18,0)
import GHC.TypeLits hiding (withKnownNat, withKnownSymbol)
#else
import GHC.TypeLits
#endif
import Data.List (intersperse)
import Data.String (fromString)
import Data.String.Conversions (cs)
import Data.List (intersperse)
import qualified Data.Text as T (concat)

import Hreq.Core.API
import Hreq.Core.Client.Request
import Hreq.Core.Client.BasicAuth
import Hreq.Core.Client.Request
import Network.HTTP.Types (QueryItem)

pattern Empty :: Hlist '[]
Expand Down
Loading