Skip to content

Commit 60bd041

Browse files
authored
Merge pull request #1760 from haskell-servant/prepare-servant-quiccheck-0.1.0.0-release
Prepare servant-quickcheck-0.1.0.0
2 parents 81753cf + ffdfeb2 commit 60bd041

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

servant-client-core/src/Servant/Client/Core/HasClient.hs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ import Data.Foldable
2626
(toList)
2727
import Data.Kind
2828
(Type)
29-
#if !MIN_VERSION_base_compat(0,14,0)
30-
import Data.List
31-
(foldl')
32-
#endif
29+
import qualified Data.List as List
3330
import Data.Sequence
3431
(fromList)
3532
import qualified Data.Text as T
@@ -232,7 +229,7 @@ instance (ToHttpApiData a, HasClient m sublayout)
232229

233230
clientWithRoute pm Proxy req vals =
234231
clientWithRoute pm (Proxy :: Proxy sublayout)
235-
(foldl' (flip appendToPath) req ps)
232+
(List.foldl' (flip appendToPath) req ps)
236233

237234
where ps = map toEncodedUrlPiece vals
238235

@@ -603,7 +600,7 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient m api)
603600

604601
clientWithRoute pm Proxy req paramlist =
605602
clientWithRoute pm (Proxy :: Proxy api)
606-
(foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
603+
(List.foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
607604
req
608605
paramlist'
609606
)
@@ -672,7 +669,7 @@ instance (KnownSymbol sym, ToDeepQuery a, HasClient m api)
672669

673670
clientWithRoute pm Proxy req deepObject =
674671
let params = toDeepQuery deepObject
675-
withParams = foldl' addDeepParam req params
672+
withParams = List.foldl' addDeepParam req params
676673
addDeepParam r' kv =
677674
let (k, textV) = generateDeepParam paramname kv
678675
in appendToQueryString k (encodeUtf8 <$> textV) r'

servant-client/src/Servant/Client/Internal/HttpClient.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ import qualified Data.ByteString as BS
3333
import Data.ByteString.Builder
3434
(toLazyByteString)
3535
import qualified Data.ByteString.Lazy as BSL
36-
#if !MIN_VERSION_base_compat(0,14,0)
37-
import Data.Foldable (foldl')
38-
#endif
39-
import Data.Foldable (toList)
36+
import qualified Data.List as List
37+
import Data.Foldable
38+
(toList)
4039
import Data.Functor.Alt
4140
(Alt (..))
4241
import Data.Maybe
@@ -294,7 +293,7 @@ defaultMakeClientRequest burl r = return Client.defaultRequest
294293

295294
-- Query string builder which does not do any encoding
296295
buildQueryString [] = mempty
297-
buildQueryString qps = "?" <> foldl' addQueryParam mempty qps
296+
buildQueryString qps = "?" <> List.foldl' addQueryParam mempty qps
298297

299298
addQueryParam qs (k, v) =
300299
qs <> (if BS.null qs then mempty else "&") <> urlEncode True k <> foldMap ("=" <>) v

servant-quickcheck/LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Copyright (c) 2024 Julian K. Arni
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8+
9+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

servant-quickcheck/servant-quickcheck.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
cabal-version: 3.4
12
name: servant-quickcheck
23
version: 0.1.0.0
34
synopsis: QuickCheck entire APIs
45
description:
56
This packages provides QuickCheck properties that are tested across an entire API.
67

7-
license: BSD3
8+
license: BSD-3-Clause
89
license-file: LICENSE
910
author: Julian K. Arni
1011
maintainer: [email protected]
1112
category: Web
1213
build-type: Simple
13-
cabal-version: >=1.10
1414
extra-source-files: CHANGELOG.yaml
1515
tested-with: GHC ==9.2.8 || ==9.4.8 || ==9.6.4 || ==9.8.1
1616

@@ -49,7 +49,7 @@ library
4949
, mtl >=2.1 && <2.4
5050
, pretty >=1.1 && <1.2
5151
, process >=1.2 && <1.7
52-
, QuickCheck >=2.7 && <2.15
52+
, QuickCheck >=2.7 && <2.16
5353
, servant >=0.18.2 && <0.21
5454
, servant-client >=0.17 && <0.21
5555
, servant-server >=0.17 && <0.21

0 commit comments

Comments
 (0)