git.iko.soy/typeable/servant
on 903ae74 help sign in
.travis.yml+10−22
since splitsnapshots
unifiedsplit
@@ -14,6 +14,7 @@ branches:
14 only:
14 only:
15 - master
15 - master
16 - release-0.12
16 - release-0.12
17+ - release-0.13
17
18
18cache:
19cache:
19 directories:
20 directories:
@@ -45,6 +46,9 @@ matrix:
45 - compiler: "ghc-8.2.2"
46 - compiler: "ghc-8.2.2"
46 # env: TEST=--disable-tests BENCH=--disable-benchmarks
47 # env: TEST=--disable-tests BENCH=--disable-benchmarks
47 addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
48 addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
49+ - compiler: "ghc-8.4.1"
50+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
51+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
48
52
49before_install:
53before_install:
50 - HC=${CC}
54 - HC=${CC}
@@ -69,9 +73,9 @@ install:
69 - rm -fv cabal.project cabal.project.local
73 - rm -fv cabal.project cabal.project.local
70 - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
74 - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
71 - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
75 - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
72− - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/basic-auth\" \"doc/cookbook/https\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/file-upload\"\\n' > cabal.project"
76+ - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/https\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/file-upload\"\\n' > cabal.project"
73 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
77 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
74− - "echo 'allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens' >> cabal.project"
78+ - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server' >> cabal.project"
75 - cat cabal.project
79 - cat cabal.project
76 - if [ -f "servant/configure.ac" ]; then
80 - if [ -f "servant/configure.ac" ]; then
77 (cd "servant" && autoreconf -i);
81 (cd "servant" && autoreconf -i);
@@ -94,18 +98,6 @@ install:
94 - if [ -f "doc/tutorial/configure.ac" ]; then
98 - if [ -f "doc/tutorial/configure.ac" ]; then
95 (cd "doc/tutorial" && autoreconf -i);
99 (cd "doc/tutorial" && autoreconf -i);
96 fi
100 fi
97− - if [ -f "doc/cookbook/db-postgres-pool/configure.ac" ]; then
98− (cd "doc/cookbook/db-postgres-pool" && autoreconf -i);
99− fi
100− - if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then
101− (cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i);
102− fi
103− - if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then
104− (cd "doc/cookbook/db-sqlite-simple" && autoreconf -i);
105− fi
106− - if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then
107− (cd "doc/cookbook/basic-auth" && autoreconf -i);
108− fi
109 - if [ -f "doc/cookbook/https/configure.ac" ]; then
101 - if [ -f "doc/cookbook/https/configure.ac" ]; then
110 (cd "doc/cookbook/https" && autoreconf -i);
102 (cd "doc/cookbook/https" && autoreconf -i);
111 fi
103 fi
@@ -119,7 +111,7 @@ install:
119 (cd "doc/cookbook/file-upload" && autoreconf -i);
111 (cd "doc/cookbook/file-upload" && autoreconf -i);
120 fi
112 fi
121 - rm -f cabal.project.freeze
113 - rm -f cabal.project.freeze
122− - rm -rf "servant"/.ghc.environment.* "servant-client"/.ghc.environment.* "servant-client-core"/.ghc.environment.* "servant-docs"/.ghc.environment.* "servant-foreign"/.ghc.environment.* "servant-server"/.ghc.environment.* "doc/tutorial"/.ghc.environment.* "doc/cookbook/db-postgres-pool"/.ghc.environment.* "doc/cookbook/jwt-and-basic-auth"/.ghc.environment.* "doc/cookbook/db-sqlite-simple"/.ghc.environment.* "doc/cookbook/basic-auth"/.ghc.environment.* "doc/cookbook/https"/.ghc.environment.* "doc/cookbook/structuring-apis"/.ghc.environment.* "doc/cookbook/using-custom-monad"/.ghc.environment.* "doc/cookbook/file-upload"/.ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/jwt-and-basic-auth"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/https"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/file-upload"/dist
114+ - rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/https"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/file-upload"/dist
123 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
115 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
124
116
125# Here starts the actual work to be performed for the package under test;
117# Here starts the actual work to be performed for the package under test;
@@ -134,22 +126,18 @@ script:
134 - (cd "servant-foreign" && cabal sdist)
126 - (cd "servant-foreign" && cabal sdist)
135 - (cd "servant-server" && cabal sdist)
127 - (cd "servant-server" && cabal sdist)
136 - (cd "doc/tutorial" && cabal sdist)
128 - (cd "doc/tutorial" && cabal sdist)
137− - (cd "doc/cookbook/db-postgres-pool" && cabal sdist)
138− - (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist)
139− - (cd "doc/cookbook/db-sqlite-simple" && cabal sdist)
140− - (cd "doc/cookbook/basic-auth" && cabal sdist)
141 - (cd "doc/cookbook/https" && cabal sdist)
129 - (cd "doc/cookbook/https" && cabal sdist)
142 - (cd "doc/cookbook/structuring-apis" && cabal sdist)
130 - (cd "doc/cookbook/structuring-apis" && cabal sdist)
143 - (cd "doc/cookbook/using-custom-monad" && cabal sdist)
131 - (cd "doc/cookbook/using-custom-monad" && cabal sdist)
144 - (cd "doc/cookbook/file-upload" && cabal sdist)
132 - (cd "doc/cookbook/file-upload" && cabal sdist)
145 - echo -en 'travis_fold:end:sdist\\r'
133 - echo -en 'travis_fold:end:sdist\\r'
146 - echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
134 - echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
147− - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/jwt-and-basic-auth"/dist/cookbook-jwt-and-basic-auth-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz ${DISTDIR}/
135+ - mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz ${DISTDIR}/
148 - cd ${DISTDIR} || false
136 - cd ${DISTDIR} || false
149 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
137 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
150− - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-https-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-file-upload-*/*.cabal\\n' > cabal.project"
138+ - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-https-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-file-upload-*/*.cabal\\n' > cabal.project"
151 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
139 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
152− - "echo 'allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens' >> cabal.project"
140+ - "echo 'allow-newer: servant-js:servant,servant-js:servant-foreign,servant-auth-server:http-types,servant-multipart:lens,servant-multipart:resourcet,servant-multipart:servant,servant-multipart:servant-server,servant-auth-server:servant-server' >> cabal.project"
153 - cat cabal.project
141 - cat cabal.project
154 - echo -en 'travis_fold:end:unpack\\r'
142 - echo -en 'travis_fold:end:unpack\\r'
155
143
cabal.make-travis-yml+1−1
@@ -1,5 +1,5 @@
1folds: all-but-test
1folds: all-but-test
2−branches: master release-0.12
2+branches: master release-0.12 release-0.13
3
3
4-- We have inplace packages (servant-js) so we skip installing dependencies in a separate step
4-- We have inplace packages (servant-js) so we skip installing dependencies in a separate step
5install-dependencies-step: False
5install-dependencies-step: False
cabal.project+21−2
@@ -5,9 +5,28 @@ packages: servant/
5 servant-foreign/
5 servant-foreign/
6 servant-server/
6 servant-server/
7 doc/tutorial/
7 doc/tutorial/
8− doc/cookbook/*/*.cabal
9
8
9+ -- doc/cookbook/*/*.cabal
10+
11+ -- doc/cookbook/db-postgres-pool
12+ -- doc/cookbook/jwt-and-basic-auth
13+ -- doc/cookbook/db-sqlite-simple
14+ -- doc/cookbook/basic-auth
15+ doc/cookbook/https
16+ doc/cookbook/structuring-apis
17+ doc/cookbook/using-custom-monad
18+ doc/cookbook/file-upload
19+
20+
21+allow-newer:
22+ servant-js:servant,
23+ servant-js:servant-foreign,
10−allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens
24+ servant-auth-server:http-types,
25+ servant-multipart:lens,
26+ servant-multipart:resourcet,
27+ servant-multipart:servant,
28+ servant-multipart:servant-server,
29+ servant-auth-server:servant-server
11
30
12constraints:
31constraints:
13 -- see https://github.com/haskell-infra/hackage-trustees/issues/119
32 -- see https://github.com/haskell-infra/hackage-trustees/issues/119
doc/cookbook/file-upload/file-upload.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
8maintainer: haskell-servant-maintainers@googlegroups.com
8maintainer: haskell-servant-maintainers@googlegroups.com
9build-type: Simple
9build-type: Simple
10cabal-version: >=1.10
10cabal-version: >=1.10
11−tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
11+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
12
12
13executable cookbook-file-upload
13executable cookbook-file-upload
14 main-is: FileUpload.lhs
14 main-is: FileUpload.lhs
doc/cookbook/https/https.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
8maintainer: haskell-servant-maintainers@googlegroups.com
8maintainer: haskell-servant-maintainers@googlegroups.com
9build-type: Simple
9build-type: Simple
10cabal-version: >=1.10
10cabal-version: >=1.10
11−tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
11+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
12
12
13executable cookbook-https
13executable cookbook-https
14 main-is: Https.lhs
14 main-is: Https.lhs
doc/cookbook/structuring-apis/structuring-apis.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
8maintainer: haskell-servant-maintainers@googlegroups.com
8maintainer: haskell-servant-maintainers@googlegroups.com
9build-type: Simple
9build-type: Simple
10cabal-version: >=1.10
10cabal-version: >=1.10
11−tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
11+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
12
12
13executable cookbook-structuring-apis
13executable cookbook-structuring-apis
14 main-is: StructuringApis.lhs
14 main-is: StructuringApis.lhs
doc/cookbook/using-custom-monad/using-custom-monad.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
8maintainer: haskell-servant-maintainers@googlegroups.com
8maintainer: haskell-servant-maintainers@googlegroups.com
9build-type: Simple
9build-type: Simple
10cabal-version: >=1.10
10cabal-version: >=1.10
11−tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
11+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
12
12
13executable cookbook-using-custom-monad
13executable cookbook-using-custom-monad
14 main-is: UsingCustomMonad.lhs
14 main-is: UsingCustomMonad.lhs
doc/tutorial/tutorial.cabal+6−5
@@ -13,10 +13,11 @@ maintainer: haskell-servant-maintainers@googlegroups.com
13build-type: Simple
13build-type: Simple
14cabal-version: >=1.10
14cabal-version: >=1.10
15tested-with:
15tested-with:
16− GHC==7.8.4
16+ GHC==7.8.4,
17− GHC==7.10.3
17+ GHC==7.10.3,
18− GHC==8.0.2
18+ GHC==8.0.2,
19− GHC==8.2.2
19+ GHC==8.2.2,
20+ GHC==8.4.1
20extra-source-files:
21extra-source-files:
21 static/index.html
22 static/index.html
22 static/ui.js
23 static/ui.js
@@ -34,7 +35,7 @@ library
34 -- Packages `servant` depends on.
35 -- Packages `servant` depends on.
35 -- We don't need to specify bounds here as this package is never released.
36 -- We don't need to specify bounds here as this package is never released.
36 build-depends:
37 build-depends:
37− base >= 4.7 && <4.11
38+ base >= 4.7 && <4.12
38 , aeson
39 , aeson
39 , aeson-compat
40 , aeson-compat
40 , attoparsec
41 , attoparsec
servant-client-core/CHANGELOG.md+14
@@ -1,6 +1,20 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client-core/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client-core/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
3
3
4+0.13.0.1
5+--------
6+
7+- Support `base-compat-0.10`
8+
9+
10+0.13
11+----
12+
13+- Streaming endpoint support.
14+ ([#836](https://github.com/haskell-servant/servant/pull/836))
15+- *servant* Add `Servant.API.Modifiers`
16+ ([#873](https://github.com/haskell-servant/servant/pull/873))
17+
40.12
180.12
5----
19----
6
20
servant-client-core/servant-client-core.cabal+13−12
@@ -1,5 +1,5 @@
1name: servant-client-core
1name: servant-client-core
2−version: 0.12
2+version: 0.13.0.1
3synopsis: Core functionality and class for client function generation for servant APIs
3synopsis: Core functionality and class for client function generation for servant APIs
4description:
4description:
5 This library provides backend-agnostic generation of client functions. For
5 This library provides backend-agnostic generation of client functions. For
@@ -19,10 +19,11 @@ extra-source-files:
19 CHANGELOG.md
19 CHANGELOG.md
20 README.md
20 README.md
21tested-with:
21tested-with:
22− GHC==7.8.4
22+ GHC==7.8.4,
23− GHC==7.10.3
23+ GHC==7.10.3,
24− GHC==8.0.2
24+ GHC==8.0.2,
25− GHC==8.2.2
25+ GHC==8.2.2,
26+ GHC==8.4.1
26
27
27source-repository head
28source-repository head
28 type: git
29 type: git
@@ -45,7 +46,7 @@ library
45 --
46 --
46 -- note: mtl lower bound is so low because of GHC-7.8
47 -- note: mtl lower bound is so low because of GHC-7.8
47 build-depends:
48 build-depends:
48− base >= 4.7 && < 4.11
49+ base >= 4.7 && < 4.12
49 , bytestring >= 0.10.4.0 && < 0.11
50 , bytestring >= 0.10.4.0 && < 0.11
50 , containers >= 0.5.5.1 && < 0.6
51 , containers >= 0.5.5.1 && < 0.6
51 , mtl >= 2.1 && < 2.3
52 , mtl >= 2.1 && < 2.3
@@ -57,17 +58,17 @@ library
57
58
58 -- Servant dependencies
59 -- Servant dependencies
59 build-depends:
60 build-depends:
60− servant == 0.12.*
61+ servant == 0.13.*
61
62
62 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
63 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
63 -- Here can be exceptions if we really need features from the newer versions.
64 -- Here can be exceptions if we really need features from the newer versions.
64 build-depends:
65 build-depends:
65− base-compat >= 0.9.3 && < 0.10
66+ base-compat >= 0.9.3 && < 0.11
66 , base64-bytestring >= 1.0.0.1 && < 1.1
67 , base64-bytestring >= 1.0.0.1 && < 1.1
67− , exceptions >= 0.8.3 && < 0.9
68+ , exceptions >= 0.8.3 && < 0.11
68 , generics-sop >= 0.3.1.0 && < 0.4
69 , generics-sop >= 0.3.1.0 && < 0.4
69 , http-api-data >= 0.3.7.1 && < 0.4
70 , http-api-data >= 0.3.7.1 && < 0.4
70− , http-media >= 0.7.1.1 && < 0.8
71+ , http-media >= 0.7.0 && < 0.8
71 , http-types >= 0.12 && < 0.13
72 , http-types >= 0.12 && < 0.13
72 , network-uri >= 2.6.1.0 && < 2.7
73 , network-uri >= 2.6.1.0 && < 2.7
73 , safe >= 0.3.15 && < 0.4
74 , safe >= 0.3.15 && < 0.4
@@ -95,8 +96,8 @@ test-suite spec
95 -- Additonal dependencies
96 -- Additonal dependencies
96 build-depends:
97 build-depends:
97 deepseq >= 1.3.0.2 && <1.5
98 deepseq >= 1.3.0.2 && <1.5
98− , hspec >= 2.4.4 && <2.5
99+ , hspec >= 2.4.4 && <2.6
99 , QuickCheck >= 2.10.1 && < 2.12
100 , QuickCheck >= 2.10.1 && < 2.12
100
101
101 build-tool-depends:
102 build-tool-depends:
102− hspec-discover:hspec-discover >= 2.4.4 && <2.5
103+ hspec-discover:hspec-discover >= 2.4.4 && <2.6
servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+4−4
@@ -21,8 +21,8 @@ import Control.Concurrent (newMVar, modifyMVar)
21import Data.Foldable (toList)
21import Data.Foldable (toList)
22import qualified Data.ByteString.Lazy as BL
22import qualified Data.ByteString.Lazy as BL
23import Data.List (foldl')
23import Data.List (foldl')
24−import Data.Monoid ((<>))
25import Data.Proxy (Proxy (Proxy))
24import Data.Proxy (Proxy (Proxy))
25+import Data.Semigroup ((<>))
26import Data.Sequence (fromList)
26import Data.Sequence (fromList)
27import Data.String (fromString)
27import Data.String (fromString)
28import Data.Text (Text, pack)
28import Data.Text (Text, pack)
@@ -34,7 +34,7 @@ import Servant.API ((:<|>) ((:<|>)), (:>),
34 BuildHeadersTo (..),
34 BuildHeadersTo (..),
35 BuildFromStream (..),
35 BuildFromStream (..),
36 ByteStringParser (..),
36 ByteStringParser (..),
37− Capture, CaptureAll,
37+ Capture', CaptureAll,
38 Description, EmptyAPI,
38 Description, EmptyAPI,
39 FramingUnrender (..),
39 FramingUnrender (..),
40 Header', Headers (..),
40 Header', Headers (..),
@@ -155,9 +155,9 @@ instance RunClient m => HasClient m EmptyAPI where
155-- > getBook = client myApi
155-- > getBook = client myApi
156-- > -- then you can just use "getBook" to query that endpoint
156-- > -- then you can just use "getBook" to query that endpoint
157instance (KnownSymbol capture, ToHttpApiData a, HasClient m api)
157instance (KnownSymbol capture, ToHttpApiData a, HasClient m api)
158− => HasClient m (Capture capture a :> api) where
158+ => HasClient m (Capture' mods capture a :> api) where
159
159
160− type Client m (Capture capture a :> api) =
160+ type Client m (Capture' mods capture a :> api) =
161 a -> Client m api
161 a -> Client m api
162
162
163 clientWithRoute pm Proxy req val =
163 clientWithRoute pm Proxy req val =
servant-client-ghcjs/servant-client-ghcjs.cabal+4−4
@@ -1,5 +1,5 @@
1name: servant-client-ghcjs
1name: servant-client-ghcjs
2−version: 0.11
2+version: 0.13
3synopsis: automatical derivation of querying functions for servant webservices for ghcjs
3synopsis: automatical derivation of querying functions for servant webservices for ghcjs
4description:
4description:
5 This library lets you automatically derive Haskell functions that
5 This library lets you automatically derive Haskell functions that
@@ -31,11 +31,11 @@ library
31 Servant.Client.Ghcjs
31 Servant.Client.Ghcjs
32 Servant.Client.Internal.XhrClient
32 Servant.Client.Internal.XhrClient
33 build-depends:
33 build-depends:
34− base >= 4.7 && < 4.11
34+ base >= 4.7 && < 4.12
35 , bytestring >= 0.10 && < 0.11
35 , bytestring >= 0.10 && < 0.11
36 , case-insensitive >= 1.2.0.0 && < 1.3.0.0
36 , case-insensitive >= 1.2.0.0 && < 1.3.0.0
37 , containers >= 0.5 && < 0.6
37 , containers >= 0.5 && < 0.6
38− , exceptions >= 0.8 && < 0.9
38+ , exceptions >= 0.8 && < 0.11
39 , ghcjs-base >= 0.2.0.0 && < 0.3.0.0
39 , ghcjs-base >= 0.2.0.0 && < 0.3.0.0
40 , ghcjs-prim >= 0.1.0.0 && < 0.2.0.0
40 , ghcjs-prim >= 0.1.0.0 && < 0.2.0.0
41 , http-media >= 0.6.2 && < 0.8
41 , http-media >= 0.6.2 && < 0.8
@@ -43,7 +43,7 @@ library
43 , monad-control >= 1.0.0.4 && < 1.1
43 , monad-control >= 1.0.0.4 && < 1.1
44 , mtl >= 2.1 && < 2.3
44 , mtl >= 2.1 && < 2.3
45 , semigroupoids >= 4.3 && < 5.3
45 , semigroupoids >= 4.3 && < 5.3
46− , servant-client-core >= 0.12 && < 0.13
46+ , servant-client-core == 0.13.*
47 , string-conversions >= 0.3 && < 0.5
47 , string-conversions >= 0.3 && < 0.5
48 , transformers >= 0.3 && < 0.6
48 , transformers >= 0.3 && < 0.6
49 , transformers-base >= 0.4.4 && < 0.5
49 , transformers-base >= 0.4.4 && < 0.5
servant-client/CHANGELOG.md+11
@@ -1,6 +1,17 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
3
3
4+0.13
5+----
6+
7+- Streaming endpoint support.
8+ ([#836](https://github.com/haskell-servant/servant/pull/836))
9+- *servant* Add `Servant.API.Modifiers`
10+ ([#873](https://github.com/haskell-servant/servant/pull/873))
11+- *servant-client* Support `http-client`’s `CookieJar`
12+ ([#897](https://github.com/haskell-servant/servant/pull/897)
13+ [#883](https://github.com/haskell-servant/servant/pull/883))
14+
40.12.0.1
150.12.0.1
5--------
16--------
6
17
servant-client/servant-client.cabal+22−16
@@ -1,5 +1,6 @@
1name: servant-client
1name: servant-client
2−version: 0.12.0.1
2+version: 0.13
3+x-revision: 2
3synopsis: automatical derivation of querying functions for servant webservices
4synopsis: automatical derivation of querying functions for servant webservices
4description:
5description:
5 This library lets you derive automatically Haskell functions that
6 This library lets you derive automatically Haskell functions that
@@ -17,10 +18,11 @@ category: Servant, Web
17build-type: Simple
18build-type: Simple
18cabal-version: >=1.10
19cabal-version: >=1.10
19tested-with:
20tested-with:
20− GHC==7.8.4
21+ GHC==7.8.4,
21− GHC==7.10.3
22+ GHC==7.10.3,
22− GHC==8.0.2
23+ GHC==8.0.2,
23− GHC==8.2.2
24+ GHC==8.2.2,
25+ GHC==8.4.1
24homepage: http://haskell-servant.readthedocs.org/
26homepage: http://haskell-servant.readthedocs.org/
25Bug-reports: http://github.com/haskell-servant/servant/issues
27Bug-reports: http://github.com/haskell-servant/servant/issues
26extra-source-files:
28extra-source-files:
@@ -41,7 +43,7 @@ library
41 --
43 --
42 -- note: mtl lower bound is so low because of GHC-7.8
44 -- note: mtl lower bound is so low because of GHC-7.8
43 build-depends:
45 build-depends:
44− base >= 4.7 && < 4.11
46+ base >= 4.7 && < 4.12
45 , bytestring >= 0.10.4.0 && < 0.11
47 , bytestring >= 0.10.4.0 && < 0.11
46 , containers >= 0.5.5.1 && < 0.6
48 , containers >= 0.5.5.1 && < 0.6
47 , mtl >= 2.1 && < 2.3
49 , mtl >= 2.1 && < 2.3
@@ -54,24 +56,24 @@ library
54
56
55 -- Servant dependencies
57 -- Servant dependencies
56 build-depends:
58 build-depends:
57− servant-client-core == 0.12.*
59+ servant-client-core == 0.13.*
58
60
59 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
61 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
60 -- Here can be exceptions if we really need features from the newer versions.
62 -- Here can be exceptions if we really need features from the newer versions.
61 build-depends:
63 build-depends:
62− aeson >= 1.2.3.0 && < 1.3
64+ aeson >= 1.2.3.0 && < 1.4
63− , base-compat >= 0.9.3 && < 0.10
65+ , base-compat >= 0.9.3 && < 0.11
64 , attoparsec >= 0.13.2.0 && < 0.14
66 , attoparsec >= 0.13.2.0 && < 0.14
65 , http-client >= 0.5.7.1 && < 0.6
67 , http-client >= 0.5.7.1 && < 0.6
66 , http-client-tls >= 0.3.5.1 && < 0.4
68 , http-client-tls >= 0.3.5.1 && < 0.4
67− , http-media >= 0.7.1.1 && < 0.8
69+ , http-media >= 0.7.0 && < 0.8
68 , http-types >= 0.12 && < 0.13
70 , http-types >= 0.12 && < 0.13
69− , exceptions >= 0.8.3 && < 0.9
71+ , exceptions >= 0.8.3 && < 0.11
70 , monad-control >= 1.0.0.4 && < 1.1
72 , monad-control >= 1.0.0.4 && < 1.1
71 , semigroupoids >= 5.2.1 && < 5.3
73 , semigroupoids >= 5.2.1 && < 5.3
72 , stm >= 2.4.4.1 && < 2.5
74 , stm >= 2.4.4.1 && < 2.5
73 , transformers-base >= 0.4.4 && < 0.5
75 , transformers-base >= 0.4.4 && < 0.5
74− , transformers-compat >= 0.5.1 && < 0.6
76+ , transformers-compat >= 0.5.1 && < 0.7
75
77
76 hs-source-dirs: src
78 hs-source-dirs: src
77 default-language: Haskell2010
79 default-language: Haskell2010
@@ -110,16 +112,20 @@ test-suite spec
110 , wai
112 , wai
111 , warp
113 , warp
112
114
115+ if !impl(ghc >= 8.0)
116+ build-depends:
117+ semigroups
118+
113 -- Additonal dependencies
119 -- Additonal dependencies
114 build-depends:
120 build-depends:
115 deepseq >= 1.3.0.2 && < 1.5
121 deepseq >= 1.3.0.2 && < 1.5
116 , generics-sop >= 0.3.1.0 && < 0.4
122 , generics-sop >= 0.3.1.0 && < 0.4
117− , hspec >= 2.4.4 && < 2.5
123+ , hspec >= 2.4.4 && < 2.6
118 , HUnit >= 1.6 && < 1.7
124 , HUnit >= 1.6 && < 1.7
119 , network >= 2.6.3.2 && < 2.7
125 , network >= 2.6.3.2 && < 2.7
120 , QuickCheck >= 2.10.1 && < 2.12
126 , QuickCheck >= 2.10.1 && < 2.12
121− , servant == 0.12.*
127+ , servant == 0.13.*
122− , servant-server == 0.12.*
128+ , servant-server == 0.13.*
123
129
124 build-tool-depends:
130 build-tool-depends:
125− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
131+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
servant-client/test/Servant/ClientSpec.hs+2−1
@@ -37,7 +37,8 @@ import Control.Monad.Error.Class (throwError)
37import Data.Aeson
37import Data.Aeson
38import Data.Char (chr, isPrint)
38import Data.Char (chr, isPrint)
39import Data.Foldable (forM_)
39import Data.Foldable (forM_)
40−import Data.Monoid hiding (getLast)
40+import Data.Semigroup ((<>))
41+import Data.Monoid ()
41import Data.Proxy
42import Data.Proxy
42import qualified Generics.SOP as SOP
43import qualified Generics.SOP as SOP
43import GHC.Generics (Generic)
44import GHC.Generics (Generic)
servant-docs/CHANGELOG.md+7
@@ -1,6 +1,13 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
3
3
4+0.11.2
5+------
6+
7+* Allow `servant-0.13`:
8+ - Doesn't have instances for streaming.
9+ - Servant.API.Modifiers extra information isn't used.
10+
40.11.1
110.11.1
5------
12------
6
13
servant-docs/servant-docs.cabal+14−12
@@ -1,5 +1,6 @@
1name: servant-docs
1name: servant-docs
2−version: 0.11.1
2+version: 0.11.2
3+x-revision: 2
3synopsis: generate API docs for your servant webservice
4synopsis: generate API docs for your servant webservice
4description:
5description:
5 Library for generating API docs from a servant API definition.
6 Library for generating API docs from a servant API definition.
@@ -16,10 +17,11 @@ category: Servant, Web
16build-type: Simple
17build-type: Simple
17cabal-version: >=1.10
18cabal-version: >=1.10
18tested-with:
19tested-with:
19− GHC==7.8.4
20+ GHC==7.8.4,
20− GHC==7.10.3
21+ GHC==7.10.3,
21− GHC==8.0.2
22+ GHC==8.0.2,
22− GHC==8.2.2
23+ GHC==8.2.2,
24+ GHC==8.4.1
23homepage: http://haskell-servant.readthedocs.org/
25homepage: http://haskell-servant.readthedocs.org/
24Bug-reports: http://github.com/haskell-servant/servant/issues
26Bug-reports: http://github.com/haskell-servant/servant/issues
25extra-source-files:
27extra-source-files:
@@ -41,7 +43,7 @@ library
41 --
43 --
42 -- note: mtl lower bound is so low because of GHC-7.8
44 -- note: mtl lower bound is so low because of GHC-7.8
43 build-depends:
45 build-depends:
44− base >= 4.7 && < 4.11
46+ base >= 4.7 && < 4.12
45 , bytestring >= 0.10.4.0 && < 0.11
47 , bytestring >= 0.10.4.0 && < 0.11
46 , text >= 1.2.3.0 && < 1.3
48 , text >= 1.2.3.0 && < 1.3
47
49
@@ -51,18 +53,18 @@ library
51
53
52 -- Servant dependencies
54 -- Servant dependencies
53 build-depends:
55 build-depends:
54− servant == 0.12.*
56+ servant == 0.13.*
55
57
56 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
58 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
57 -- Here can be exceptions if we really need features from the newer versions.
59 -- Here can be exceptions if we really need features from the newer versions.
58 build-depends:
60 build-depends:
59− aeson >= 1.2.3.0 && < 1.3
61+ aeson >= 1.2.3.0 && < 1.4
60 , aeson-pretty >= 0.8.5 && < 0.9
62 , aeson-pretty >= 0.8.5 && < 0.9
61− , base-compat >= 0.9.3 && < 0.10
63+ , base-compat >= 0.9.3 && < 0.11
62 , case-insensitive >= 1.2.0.10 && < 1.3
64 , case-insensitive >= 1.2.0.10 && < 1.3
63 , control-monad-omega >= 0.3.1 && < 0.4
65 , control-monad-omega >= 0.3.1 && < 0.4
64 , hashable >= 1.2.6.1 && < 1.3
66 , hashable >= 1.2.6.1 && < 1.3
65− , http-media >= 0.7.1.1 && < 0.8
67+ , http-media >= 0.7.0 && < 0.8
66 , http-types >= 0.12 && < 0.13
68 , http-types >= 0.12 && < 0.13
67 , lens >= 4.15.4 && < 4.17
69 , lens >= 4.15.4 && < 4.17
68 , string-conversions >= 0.4.0.1 && < 0.5
70 , string-conversions >= 0.4.0.1 && < 0.5
@@ -108,7 +110,7 @@ test-suite spec
108
110
109 -- Additonal dependencies
111 -- Additonal dependencies
110 build-depends:
112 build-depends:
111− hspec >= 2.4.4 && < 2.5
113+ hspec >= 2.4.4 && < 2.6
112
114
113 build-tool-depends:
115 build-tool-depends:
114− hspec-discover:hspec-discover >=2.4.4 && <2.5
116+ hspec-discover:hspec-discover >=2.4.4 && <2.6
servant-docs/src/Servant/Docs/Internal.hs+1−1
@@ -795,7 +795,7 @@ instance HasDocs EmptyAPI where
795-- | @"books" :> 'Capture' "isbn" Text@ will appear as
795-- | @"books" :> 'Capture' "isbn" Text@ will appear as
796-- @/books/:isbn@ in the docs.
796-- @/books/:isbn@ in the docs.
797instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
797instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
798− => HasDocs (Capture sym a :> api) where
798+ => HasDocs (Capture' mods sym a :> api) where
799
799
800 docsFor Proxy (endpoint, action) =
800 docsFor Proxy (endpoint, action) =
801 docsFor subApiP (endpoint', action')
801 docsFor subApiP (endpoint', action')
servant-foreign/CHANGELOG.md+8−1
@@ -1,12 +1,19 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-foreign/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-foreign/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
3
3
4+0.11.1
5+------
6+
7+- Add missing `Semigroup` instances
8+
40.11
90.11
5----
10----
6
11
7### Breaking changes
12### Breaking changes
8
13
14+- *servant* Add `Servant.API.Modifiers`
15+ ([#873](https://github.com/haskell-servant/servant/pull/873))
9−* Make foreign client Header arguments have the representation of 'Maybe' in those languages
16+- Make foreign client Header arguments have the representation of 'Maybe' in those languages
10 ([#843](https://github.com/haskell-servant/servant/pull/843))
17 ([#843](https://github.com/haskell-servant/servant/pull/843))
11
18
120.10.2
190.10.2
servant-foreign/servant-foreign.cabal+16−10
@@ -1,5 +1,6 @@
1name: servant-foreign
1name: servant-foreign
2−version: 0.11
2+version: 0.11.1
3+x-revision: 1
3synopsis: Helpers for generating clients for servant APIs in any programming language
4synopsis: Helpers for generating clients for servant APIs in any programming language
4description:
5description:
5 Helper types and functions for generating client functions for servant APIs in any programming language
6 Helper types and functions for generating client functions for servant APIs in any programming language
@@ -23,10 +24,11 @@ extra-source-files:
23 README.md
24 README.md
24bug-reports: http://github.com/haskell-servant/servant/issues
25bug-reports: http://github.com/haskell-servant/servant/issues
25tested-with:
26tested-with:
26− GHC==7.8.4
27+ GHC==7.8.4,
27− GHC==7.10.3
28+ GHC==7.10.3,
28− GHC==8.0.2
29+ GHC==8.0.2,
29− GHC==8.2.2
30+ GHC==8.2.2,
31+ GHC==8.4.1
30
32
31source-repository head
33source-repository head
32 type: git
34 type: git
@@ -42,17 +44,21 @@ library
42 --
44 --
43 -- note: mtl lower bound is so low because of GHC-7.8
45 -- note: mtl lower bound is so low because of GHC-7.8
44 build-depends:
46 build-depends:
45− base >= 4.7 && <4.11
47+ base >= 4.7 && <4.12
46 , text >= 1.2.3.0 && < 1.3
48 , text >= 1.2.3.0 && < 1.3
47
49
50+ if !impl(ghc >= 8.0)
51+ build-depends:
52+ semigroups >=0.18.3 && <0.19
53+
48 -- Servant dependencies
54 -- Servant dependencies
49 build-depends:
55 build-depends:
50− servant == 0.12.*
56+ servant == 0.13.*
51
57
52 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
58 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
53 -- Here can be exceptions if we really need features from the newer versions.
59 -- Here can be exceptions if we really need features from the newer versions.
54 build-depends:
60 build-depends:
55− base-compat >= 0.9.3 && <0.10
61+ base-compat >= 0.9.3 && <0.11
56 , lens >= 4.15.4 && <4.17
62 , lens >= 4.15.4 && <4.17
57 , http-types >= 0.12 && < 0.13
63 , http-types >= 0.12 && < 0.13
58
64
@@ -79,8 +85,8 @@ test-suite spec
79
85
80 -- Additonal dependencies
86 -- Additonal dependencies
81 build-depends:
87 build-depends:
82− hspec >= 2.4.4 && <2.5
88+ hspec >= 2.4.4 && <2.6
83
89
84 build-tool-depends:
90 build-tool-depends:
85− hspec-discover:hspec-discover >=2.4.4 && <2.5
91+ hspec-discover:hspec-discover >=2.4.4 && <2.6
86 default-language: Haskell2010
92 default-language: Haskell2010
servant-foreign/src/Servant/Foreign/Internal.hs+5−4
@@ -27,6 +27,7 @@ import Control.Lens (makePrisms, makeLenses, Getter, (&), (<>~), (%~),
27 (.~))
27 (.~))
28import Data.Data (Data)
28import Data.Data (Data)
29import Data.Proxy
29import Data.Proxy
30+import Data.Semigroup (Semigroup)
30import Data.String
31import Data.String
31import Data.Text
32import Data.Text
32import Data.Typeable (Typeable)
33import Data.Typeable (Typeable)
@@ -38,12 +39,12 @@ import Servant.API.TypeLevel
38import Servant.API.Modifiers (RequiredArgument)
39import Servant.API.Modifiers (RequiredArgument)
39
40
40newtype FunctionName = FunctionName { unFunctionName :: [Text] }
41newtype FunctionName = FunctionName { unFunctionName :: [Text] }
41− deriving (Data, Show, Eq, Monoid, Typeable)
42+ deriving (Data, Show, Eq, Semigroup, Monoid, Typeable)
42
43
43makePrisms ''FunctionName
44makePrisms ''FunctionName
44
45
45newtype PathSegment = PathSegment { unPathSegment :: Text }
46newtype PathSegment = PathSegment { unPathSegment :: Text }
46− deriving (Data, Show, Eq, IsString, Monoid, Typeable)
47+ deriving (Data, Show, Eq, IsString, Semigroup, Monoid, Typeable)
47
48
48makePrisms ''PathSegment
49makePrisms ''PathSegment
49
50
@@ -195,8 +196,8 @@ instance HasForeign lang ftype EmptyAPI where
195 foreignFor Proxy Proxy Proxy _ = EmptyForeignAPI
196 foreignFor Proxy Proxy Proxy _ = EmptyForeignAPI
196
197
197instance (KnownSymbol sym, HasForeignType lang ftype t, HasForeign lang ftype api)
198instance (KnownSymbol sym, HasForeignType lang ftype t, HasForeign lang ftype api)
198− => HasForeign lang ftype (Capture sym t :> api) where
199+ => HasForeign lang ftype (Capture' mods sym t :> api) where
199− type Foreign ftype (Capture sym t :> api) = Foreign ftype api
200+ type Foreign ftype (Capture' mods sym t :> api) = Foreign ftype api
200
201
201 foreignFor lang Proxy Proxy req =
202 foreignFor lang Proxy Proxy req =
202 foreignFor lang Proxy (Proxy :: Proxy api) $
203 foreignFor lang Proxy (Proxy :: Proxy api) $
servant-server/CHANGELOG.md+13
@@ -1,6 +1,19 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-server/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-server/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
3
3
4+0.13.0.1
5+--------
6+
7+- Support `base-compat-0.10`
8+
9+0.13
10+----
11+
12+- Streaming endpoint support.
13+ ([#836](https://github.com/haskell-servant/servant/pull/836))
14+- *servant* Add `Servant.API.Modifiers`
15+ ([#873](https://github.com/haskell-servant/servant/pull/873))
16+
40.12
170.12
5----
18----
6
19
servant-server/servant-server.cabal+22−17
@@ -1,5 +1,5 @@
1name: servant-server
1name: servant-server
2−version: 0.12
2+version: 0.13.0.1
3synopsis: A family of combinators for defining webservices APIs and serving them
3synopsis: A family of combinators for defining webservices APIs and serving them
4description:
4description:
5 A family of combinators for defining webservices APIs and serving them
5 A family of combinators for defining webservices APIs and serving them
@@ -22,10 +22,11 @@ category: Servant, Web
22build-type: Custom
22build-type: Custom
23cabal-version: >=1.10
23cabal-version: >=1.10
24tested-with:
24tested-with:
25− GHC==7.8.4
25+ GHC==7.8.4,
26− GHC==7.10.3
26+ GHC==7.10.3,
27− GHC==8.0.2
27+ GHC==8.0.2,
28− GHC==8.2.2
28+ GHC==8.2.2,
29+ GHC==8.4.1
29extra-source-files:
30extra-source-files:
30 include/*.h
31 include/*.h
31 CHANGELOG.md
32 CHANGELOG.md
@@ -60,7 +61,7 @@ library
60 --
61 --
61 -- note: mtl lower bound is so low because of GHC-7.8
62 -- note: mtl lower bound is so low because of GHC-7.8
62 build-depends:
63 build-depends:
63− base >= 4.7 && < 4.11
64+ base >= 4.7 && < 4.12
64 , bytestring >= 0.10.4.0 && < 0.11
65 , bytestring >= 0.10.4.0 && < 0.11
65 , containers >= 0.5.5.1 && < 0.6
66 , containers >= 0.5.5.1 && < 0.6
66 , mtl >= 2.1 && < 2.3
67 , mtl >= 2.1 && < 2.3
@@ -68,20 +69,24 @@ library
68 , transformers >= 0.3.0.0 && < 0.6
69 , transformers >= 0.3.0.0 && < 0.6
69 , filepath >= 1.3.0.2 && < 1.5
70 , filepath >= 1.3.0.2 && < 1.5
70
71
72+ if !impl(ghc >= 8.0)
73+ build-depends:
74+ semigroups >= 0.18.3 && < 0.19
75+
71 -- Servant dependencies
76 -- Servant dependencies
72 build-depends:
77 build-depends:
73− servant == 0.12.*
78+ servant == 0.13.*
74
79
75 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
80 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
76 -- Here can be exceptions if we really need features from the newer versions.
81 -- Here can be exceptions if we really need features from the newer versions.
77 build-depends:
82 build-depends:
78− aeson >= 1.2.3.0 && < 1.3
83+ aeson >= 1.2.3.0 && < 1.4
79− , base-compat >= 0.9.3 && < 0.10
84+ , base-compat >= 0.9.3 && < 0.11
80 , attoparsec >= 0.13.2.0 && < 0.14
85 , attoparsec >= 0.13.2.0 && < 0.14
81 , base64-bytestring >= 1.0.0.1 && < 1.1
86 , base64-bytestring >= 1.0.0.1 && < 1.1
82− , exceptions >= 0.8.3 && < 0.9
87+ , exceptions >= 0.8.3 && < 0.11
83 , http-api-data >= 0.3.7.1 && < 0.4
88 , http-api-data >= 0.3.7.1 && < 0.4
84− , http-media >= 0.7.1.1 && < 0.8
89+ , http-media >= 0.7.0 && < 0.8
85 , http-types >= 0.12 && < 0.13
90 , http-types >= 0.12 && < 0.13
86 , network-uri >= 2.6.1.0 && < 2.7
91 , network-uri >= 2.6.1.0 && < 2.7
87 , monad-control >= 1.0.0.4 && < 1.1
92 , monad-control >= 1.0.0.4 && < 1.1
@@ -90,10 +95,10 @@ library
90 , split >= 0.2.3.2 && < 0.3
95 , split >= 0.2.3.2 && < 0.3
91 , string-conversions >= 0.4.0.1 && < 0.5
96 , string-conversions >= 0.4.0.1 && < 0.5
92 , system-filepath >= 0.4 && < 0.5
97 , system-filepath >= 0.4 && < 0.5
93− , resourcet >= 1.1.10 && < 1.2
98+ , resourcet >= 1.1.9 && < 1.3
94 , tagged >= 0.8.5 && < 0.9
99 , tagged >= 0.8.5 && < 0.9
95 , transformers-base >= 0.4.4 && < 0.5
100 , transformers-base >= 0.4.4 && < 0.5
96− , transformers-compat >= 0.5.1 && < 0.6
101+ , transformers-compat >= 0.5.1 && < 0.7
97 , wai >= 3.2.1.1 && < 3.3
102 , wai >= 3.2.1.1 && < 3.3
98 , wai-app-static >= 3.1.6.1 && < 3.2
103 , wai-app-static >= 3.1.6.1 && < 3.2
99 , warp >= 3.2.13 && < 3.3
104 , warp >= 3.2.13 && < 3.3
@@ -164,22 +169,22 @@ test-suite spec
164 -- Additonal dependencies
169 -- Additonal dependencies
165 build-depends:
170 build-depends:
166 directory >= 1.2.1.0 && < 1.4
171 directory >= 1.2.1.0 && < 1.4
167− , hspec >= 2.4.4 && < 2.5
172+ , hspec >= 2.4.4 && < 2.6
168 , hspec-wai >= 0.9 && < 0.10
173 , hspec-wai >= 0.9 && < 0.10
169 , should-not-typecheck >= 2.1.0 && < 2.2
174 , should-not-typecheck >= 2.1.0 && < 2.2
170 , parsec >= 3.1.11 && < 3.2
175 , parsec >= 3.1.11 && < 3.2
171 , QuickCheck >= 2.10.1 && < 2.12
176 , QuickCheck >= 2.10.1 && < 2.12
172 , wai-extra >= 3.0.21.0 && < 3.1
177 , wai-extra >= 3.0.21.0 && < 3.1
173− , temporary >= 1.2.0.3 && < 1.3
178+ , temporary >= 1.2.0.3 && < 1.4
174
179
175 build-tool-depends:
180 build-tool-depends:
176− hspec-discover:hspec-discover >=2.4.4 && <2.5
181+ hspec-discover:hspec-discover >=2.4.4 && <2.6
177
182
178test-suite doctests
183test-suite doctests
179 build-depends:
184 build-depends:
180 base
185 base
181 , servant-server
186 , servant-server
182− , doctest >= 0.13.0 && <0.14
187+ , doctest >= 0.13.0 && <0.16
183 type: exitcode-stdio-1.0
188 type: exitcode-stdio-1.0
184 main-is: test/doctests.hs
189 main-is: test/doctests.hs
185 buildable: True
190 buildable: True
servant-server/src/Servant/Server/Internal.hs+9−8
@@ -44,8 +44,9 @@ import qualified Data.ByteString.Lazy as BL
44import Data.Maybe (fromMaybe, mapMaybe,
44import Data.Maybe (fromMaybe, mapMaybe,
45 isNothing, maybeToList)
45 isNothing, maybeToList)
46import Data.Either (partitionEithers)
46import Data.Either (partitionEithers)
47+import Data.Semigroup ((<>))
47import Data.String (IsString (..))
48import Data.String (IsString (..))
48−import Data.String.Conversions (cs, (<>))
49+import Data.String.Conversions (cs)
49import Data.Tagged (Tagged(..), retag, untag)
50import Data.Tagged (Tagged(..), retag, untag)
50import qualified Data.Text as T
51import qualified Data.Text as T
51import Data.Typeable
52import Data.Typeable
@@ -67,7 +68,7 @@ import Web.HttpApiData (FromHttpApiData, parseHeader,
67 parseQueryParam,
68 parseQueryParam,
68 parseUrlPieceMaybe,
69 parseUrlPieceMaybe,
69 parseUrlPieces)
70 parseUrlPieces)
70−import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture,
71+import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture',
71 CaptureAll, Verb, EmptyAPI,
72 CaptureAll, Verb, EmptyAPI,
72 ReflectMethod(reflectMethod),
73 ReflectMethod(reflectMethod),
73 IsSecure(..), Header', QueryFlag,
74 IsSecure(..), Header', QueryFlag,
@@ -164,9 +165,9 @@ instance (HasServer a context, HasServer b context) => HasServer (a :<|> b) cont
164-- > where getBook :: Text -> Handler Book
165-- > where getBook :: Text -> Handler Book
165-- > getBook isbn = ...
166-- > getBook isbn = ...
166instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
167instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
167− => HasServer (Capture capture a :> api) context where
168+ => HasServer (Capture' mods capture a :> api) context where
168
169
169− type ServerT (Capture capture a :> api) m =
170+ type ServerT (Capture' mods capture a :> api) m =
170 a -> ServerT api m
171 a -> ServerT api m
171
172
172 hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
173 hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
@@ -749,14 +750,14 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
749-- ...
750-- ...
750-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
751-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
751-- ...Maybe you haven't applied enough arguments to
752-- ...Maybe you haven't applied enough arguments to
752−-- ...Capture "foo"
753+-- ...Capture' '[] "foo"
753-- ...
754-- ...
754--
755--
755-- >>> undefined :: Server (Capture "foo" :> Get '[JSON] Int)
756-- >>> undefined :: Server (Capture "foo" :> Get '[JSON] Int)
756-- ...
757-- ...
757-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
758-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
758-- ...Maybe you haven't applied enough arguments to
759-- ...Maybe you haven't applied enough arguments to
759−-- ...Capture "foo"
760+-- ...Capture' '[] "foo"
760-- ...
761-- ...
761--
762--
762instance TypeError (HasServerArrowKindError arr) => HasServer ((arr :: k -> l) :> api) context
763instance TypeError (HasServerArrowKindError arr) => HasServer ((arr :: k -> l) :> api) context
@@ -778,7 +779,7 @@ type HasServerArrowKindError arr =
778-- ...
779-- ...
779-- ...No instance HasServer (a -> b).
780-- ...No instance HasServer (a -> b).
780-- ...Maybe you have used '->' instead of ':>' between
781-- ...Maybe you have used '->' instead of ':>' between
781−-- ...Capture "foo" Int
782+-- ...Capture' '[] "foo" Int
782-- ...and
783-- ...and
783-- ...Verb 'GET 200 '[JSON] Int
784-- ...Verb 'GET 200 '[JSON] Int
784-- ...
785-- ...
@@ -787,7 +788,7 @@ type HasServerArrowKindError arr =
787-- ...
788-- ...
788-- ...No instance HasServer (a -> b).
789-- ...No instance HasServer (a -> b).
789-- ...Maybe you have used '->' instead of ':>' between
790-- ...Maybe you have used '->' instead of ':>' between
790−-- ...Capture "foo" Int
791+-- ...Capture' '[] "foo" Int
791-- ...and
792-- ...and
792-- ...Verb 'GET 200 '[JSON] Int
793-- ...Verb 'GET 200 '[JSON] Int
793-- ...
794-- ...
servant-server/src/Servant/Server/Internal/RoutingApplication.hs+15−7
@@ -13,11 +13,11 @@ module Servant.Server.Internal.RoutingApplication where
13import Control.Monad (ap, liftM)
13import Control.Monad (ap, liftM)
14import Control.Monad.Base (MonadBase (..))
14import Control.Monad.Base (MonadBase (..))
15import Control.Monad.Catch (MonadThrow (..))
15import Control.Monad.Catch (MonadThrow (..))
16−import Control.Monad.Reader (MonadReader (..), ReaderT, runReaderT)
16+import Control.Monad.Reader (MonadReader (..), ReaderT (..), runReaderT)
17import Control.Monad.Trans (MonadIO (..), MonadTrans (..))
17import Control.Monad.Trans (MonadIO (..), MonadTrans (..))
18import Control.Monad.Trans.Control (ComposeSt, MonadBaseControl (..), MonadTransControl (..),
18import Control.Monad.Trans.Control (ComposeSt, MonadBaseControl (..), MonadTransControl (..),
19 defaultLiftBaseWith, defaultRestoreM)
19 defaultLiftBaseWith, defaultRestoreM)
20−import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT)
20+import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT, withInternalState, runInternalState)
21import Network.Wai (Application, Request, Response, ResponseReceived)
21import Network.Wai (Application, Request, Response, ResponseReceived)
22import Prelude ()
22import Prelude ()
23import Prelude.Compat
23import Prelude.Compat
@@ -84,7 +84,6 @@ instance MonadTransControl RouteResultT where
84instance MonadThrow m => MonadThrow (RouteResultT m) where
84instance MonadThrow m => MonadThrow (RouteResultT m) where
85 throwM = lift . throwM
85 throwM = lift . throwM
86
86
87−
88toApplication :: RoutingApplication -> Application
87toApplication :: RoutingApplication -> Application
89toApplication ra request respond = ra request routingRespond
88toApplication ra request respond = ra request routingRespond
90 where
89 where
@@ -194,18 +193,27 @@ newtype DelayedIO a = DelayedIO { runDelayedIO' :: ReaderT Request (ResourceT (R
194 deriving
193 deriving
195 ( Functor, Applicative, Monad
194 ( Functor, Applicative, Monad
196 , MonadIO, MonadReader Request
195 , MonadIO, MonadReader Request
197− , MonadBase IO
198 , MonadThrow
196 , MonadThrow
199 , MonadResource
197 , MonadResource
200 )
198 )
201
199
200+instance MonadBase IO DelayedIO where
201+ liftBase = liftIO
202+
202liftRouteResult :: RouteResult a -> DelayedIO a
203liftRouteResult :: RouteResult a -> DelayedIO a
203liftRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
204liftRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
204
205
205instance MonadBaseControl IO DelayedIO where
206instance MonadBaseControl IO DelayedIO where
206− type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
207+ -- type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
207− liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
208+ -- liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
208− restoreM = DelayedIO . restoreM
209+ -- restoreM = DelayedIO . restoreM
210+
211+ type StM DelayedIO a = RouteResult a
212+ liftBaseWith f = DelayedIO $ ReaderT $ \req -> withInternalState $ \s ->
213+ liftBaseWith $ \runInBase -> f $ \x ->
214+ runInBase (runInternalState (runReaderT (runDelayedIO' x) req) s)
215+ restoreM = DelayedIO . lift . withInternalState . const . restoreM
216+
209
217
210runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a)
218runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a)
211runDelayedIO m req = transResourceT runRouteResultT $ runReaderT (runDelayedIO' m) req
219runDelayedIO m req = transResourceT runRouteResultT $ runReaderT (runDelayedIO' m) req
servant/CHANGELOG.md+82
@@ -1,5 +1,87 @@
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
1[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
2
2
3+0.13.0.1
4+--------
5+
6+- Support `base-compat-0.10`
7+
8+0.13
9+----
10+
11+### Significant changes
12+
13+- Streaming endpoint support.
14+ ([#836](https://github.com/haskell-servant/servant/pull/836))
15+
16+ ```haskell
17+ type StreamApi f = "streamGetNewline" :> StreamGet NewlineFraming JSON (f Person)
18+ ```
19+
20+ See tutorial for more details
21+ - [A web API as a type - StreamGet and StreamPost](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/ApiType.html#streamget-and-streampost)
22+ - [Serving an API - streaming endpoints](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Server.html#streaming-endpoints)
23+ - [Querying an API - Querying Streaming APIs](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Client.html#querying-streaming-apis)
24+
25+- *servant* Add `Servant.API.Modifiers`
26+ ([#873](https://github.com/haskell-servant/servant/pull/873)
27+ [#903](https://github.com/haskell-servant/servant/pull/903))
28+
29+ `QueryParam`, `Header` and `ReqBody` understand modifiers:
30+ - `Required` or `Optional` (resulting in `a` or `Maybe a` in handlers)
31+ - `Strict` or `Lenient` (resulting in `a` or `Either String a` in handlers)
32+
33+ Also you can use `Description` as a modifier, but it doesn't yet work
34+ with `servant-docs`, only `servant-swagger`. [There is an issue.](https://github.com/haskell-servant/servant/issues/902)
35+
36+- *servant-client* Support `http-client`’s `CookieJar`
37+ ([#897](https://github.com/haskell-servant/servant/pull/897)
38+ [#883](https://github.com/haskell-servant/servant/pull/883))
39+
40+ `ClientM` preserves cookies between requests,
41+ if given initial `CookieJar`.
42+ To migrate from older code, change `ClientEnv` constructor
43+ to `mkClientEnv` which makes `ClientEnv` without `CookieJar`.
44+
45+- *servant* Mono-kind-ise modifiers, resulting in better error messages.
46+ ([#887](https://github.com/haskell-servant/servant/issues/887)
47+ [#890](https://github.com/haskell-servant/servant/pull/890))
48+
49+- *servant* Add `TypeError ... => HasServer`s instances in GHC-8.2 for
50+ not saturated modifiers (`Capture "foo" :> ...`) or `->` in place of `:>`.
51+ ([#893](https://github.com/haskell-servant/servant/pull/893))
52+
53+- *Cookbook* example projects at
54+ http://haskell-servant.readthedocs.io/en/master/cookbook/index.html
55+ ([#867](https://github.com/haskell-servant/servant/pull/867)
56+ [#892](https://github.com/haskell-servant/servant/pull/882))
57+
58+- *Experimental work* `servant-client-ghcjs`
59+ ([#818](https://github.com/haskell-servant/servant/pull/818)
60+ [#869](https://github.com/haskell-servant/servant/pull/869))
61+
62+### Other changes
63+
64+- *servant* Links aren't double escaped
65+ ([#878](https://github.com/haskell-servant/servant/pull/878))
66+
67+- Dependency updates
68+ ([#900](https://github.com/haskell-servant/servant/pull/900)
69+ [#898](https://github.com/haskell-servant/servant/pull/898)
70+ [#895](https://github.com/haskell-servant/servant/pull/895)
71+ [#872](https://github.com/haskell-servant/servant/pull/872))
72+
73+- Documentation updates
74+ ([#875](https://github.com/haskell-servant/servant/pull/875)
75+ [#861](https://github.com/haskell-servant/servant/pull/861))
76+
77+- Refactorings
78+ ([#899](https://github.com/haskell-servant/servant/pull/899)
79+ [#896](https://github.com/haskell-servant/servant/pull/896)
80+ [#889](https://github.com/haskell-servant/servant/pull/889)
81+ [#891](https://github.com/haskell-servant/servant/pull/891)
82+ [#892](https://github.com/haskell-servant/servant/pull/892)
83+ [#885](https://github.com/haskell-servant/servant/pull/885))
84+
30.12.1
850.12.1
4------
86------
5
87
servant/servant.cabal+15−14
@@ -1,5 +1,5 @@
1name: servant
1name: servant
2−version: 0.12
2+version: 0.13.0.1
3synopsis: A family of combinators for defining webservices APIs
3synopsis: A family of combinators for defining webservices APIs
4description:
4description:
5 A family of combinators for defining webservices APIs and serving them
5 A family of combinators for defining webservices APIs and serving them
@@ -18,10 +18,11 @@ category: Servant, Web
18build-type: Custom
18build-type: Custom
19cabal-version: >=1.10
19cabal-version: >=1.10
20tested-with:
20tested-with:
21− GHC==7.8.4
21+ GHC==7.8.4,
22− GHC==7.10.3
22+ GHC==7.10.3,
23− GHC==8.0.2
23+ GHC==8.0.2,
24− GHC==8.2.2
24+ GHC==8.2.2,
25+ GHC==8.4.1
25extra-source-files:
26extra-source-files:
26 include/*.h
27 include/*.h
27 CHANGELOG.md
28 CHANGELOG.md
@@ -69,7 +70,7 @@ library
69 --
70 --
70 -- note: mtl lower bound is so low because of GHC-7.8
71 -- note: mtl lower bound is so low because of GHC-7.8
71 build-depends:
72 build-depends:
72− base >= 4.7 && < 4.11
73+ base >= 4.7 && < 4.12
73 , bytestring >= 0.10.4.0 && < 0.11
74 , bytestring >= 0.10.4.0 && < 0.11
74 , mtl >= 2.1 && < 2.3
75 , mtl >= 2.1 && < 2.3
75 , text >= 1.2.3.0 && < 1.3
76 , text >= 1.2.3.0 && < 1.3
@@ -80,13 +81,13 @@ library
80
81
81 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
82 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
82 -- Here can be exceptions if we really need features from the newer versions.
83 -- Here can be exceptions if we really need features from the newer versions.
83− build-depends:
84+ build-depends:
84− base-compat >= 0.9.3 && < 0.10
85+ base-compat >= 0.9.3 && < 0.11
85− , aeson >= 1.2.3.0 && < 1.3
86+ , aeson >= 1.2.3.0 && < 1.4
86 , attoparsec >= 0.13.2.0 && < 0.14
87 , attoparsec >= 0.13.2.0 && < 0.14
87 , case-insensitive >= 1.2.0.10 && < 1.3
88 , case-insensitive >= 1.2.0.10 && < 1.3
88 , http-api-data >= 0.3.7.1 && < 0.4
89 , http-api-data >= 0.3.7.1 && < 0.4
89− , http-media >= 0.7.1.1 && < 0.8
90+ , http-media >= 0.7.0 && < 0.8
90 , http-types >= 0.12 && < 0.13
91 , http-types >= 0.12 && < 0.13
91 , natural-transformation >= 0.4 && < 0.5
92 , natural-transformation >= 0.4 && < 0.5
92 , mmorph >= 1.1.0 && < 1.2
93 , mmorph >= 1.1.0 && < 1.2
@@ -153,22 +154,22 @@ test-suite spec
153 -- Additonal dependencies
154 -- Additonal dependencies
154 build-depends:
155 build-depends:
155 aeson-compat >= 0.3.3 && < 0.4
156 aeson-compat >= 0.3.3 && < 0.4
156− , hspec >= 2.4.4 && < 2.5
157+ , hspec >= 2.4.4 && < 2.6
157 , QuickCheck >= 2.10.1 && < 2.12
158 , QuickCheck >= 2.10.1 && < 2.12
158 , quickcheck-instances >= 0.3.16 && < 0.4
159 , quickcheck-instances >= 0.3.16 && < 0.4
159
160
160 build-tool-depends:
161 build-tool-depends:
161− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
162+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
162
163
163test-suite doctests
164test-suite doctests
164 build-depends:
165 build-depends:
165 base
166 base
166 , servant
167 , servant
167− , doctest >= 0.13.0 && <0.14
168+ , doctest >= 0.13.0 && <0.16
168
169
169 -- We test Links failure with doctest, so we need extra dependencies
170 -- We test Links failure with doctest, so we need extra dependencies
170 build-depends:
171 build-depends:
171− hspec >= 2.4.4 && < 2.5
172+ hspec >= 2.4.4 && < 2.6
172
173
173 type: exitcode-stdio-1.0
174 type: exitcode-stdio-1.0
174 main-is: test/doctests.hs
175 main-is: test/doctests.hs
servant/src/Servant/API.hs+1−1
@@ -74,7 +74,7 @@ module Servant.API (
74
74
75import Servant.API.Alternative ((:<|>) (..))
75import Servant.API.Alternative ((:<|>) (..))
76import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
76import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
77−import Servant.API.Capture (Capture, CaptureAll)
77+import Servant.API.Capture (Capture, Capture', CaptureAll)
78import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
78import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
79 JSON,
79 JSON,
80 MimeRender (..), NoContent (NoContent),
80 MimeRender (..), NoContent (NoContent),
servant/src/Servant/API/Capture.hs+5−3
@@ -2,7 +2,7 @@
2{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE PolyKinds #-}
3{-# LANGUAGE PolyKinds #-}
4{-# OPTIONS_HADDOCK not-home #-}
4{-# OPTIONS_HADDOCK not-home #-}
5−module Servant.API.Capture (Capture, CaptureAll) where
5+module Servant.API.Capture (Capture, Capture', CaptureAll) where
6
6
7import Data.Typeable (Typeable)
7import Data.Typeable (Typeable)
8import GHC.TypeLits (Symbol)
8import GHC.TypeLits (Symbol)
@@ -12,9 +12,11 @@ import GHC.TypeLits (Symbol)
12--
12--
13-- >>> -- GET /books/:isbn
13-- >>> -- GET /books/:isbn
14-- >>> type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book
14-- >>> type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book
15−data Capture (sym :: Symbol) (a :: *)
15+type Capture = Capture' '[] -- todo
16− deriving (Typeable)
17
16
17+-- | 'Capture' which can be modified. For example with 'Description'.
18+data Capture' (mods :: [*]) (sym :: Symbol) (a :: *)
19+ deriving (Typeable)
18
20
19-- | Capture all remaining values from the request path under a certain type
21-- | Capture all remaining values from the request path under a certain type
20-- @a@.
22-- @a@.
servant/src/Servant/API/Description.hs+45−5
@@ -1,11 +1,25 @@
1−{-# LANGUAGE DataKinds #-}
1+{-# LANGUAGE DataKinds #-}
2−{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE FlexibleContexts #-}
3−{-# LANGUAGE PolyKinds #-}
4+{-# LANGUAGE PolyKinds #-}
5+{-# LANGUAGE ScopedTypeVariables #-}
6+{-# LANGUAGE TypeOperators #-}
7+{-# LANGUAGE TypeFamilies #-}
4{-# OPTIONS_HADDOCK not-home #-}
8{-# OPTIONS_HADDOCK not-home #-}
5−module Servant.API.Description (Description, Summary) where
9+module Servant.API.Description (
10+ -- * Combinators
11+ Description,
12+ Summary,
13+ -- * Used as modifiers
14+ FoldDescription,
15+ FoldDescription',
16+ reflectDescription,
17+ ) where
6
18
7import Data.Typeable (Typeable)
19import Data.Typeable (Typeable)
8−import GHC.TypeLits (Symbol)
20+import GHC.TypeLits (Symbol, KnownSymbol, symbolVal)
21+import Data.Proxy (Proxy (..))
22+
9-- | Add a short summary for (part of) API.
23-- | Add a short summary for (part of) API.
10--
24--
11-- Example:
25-- Example:
@@ -29,6 +43,32 @@ data Summary (sym :: Symbol)
29data Description (sym :: Symbol)
43data Description (sym :: Symbol)
30 deriving (Typeable)
44 deriving (Typeable)
31
45
46+-- | Fold modifier list to decide whether argument should be parsed strictly or leniently.
47+--
48+-- >>> :kind! FoldDescription '[]
49+-- FoldDescription '[] :: Symbol
50+-- = ""
51+--
52+-- >>> :kind! FoldDescription '[Required, Description "foobar", Lenient]
53+-- FoldDescription '[Required, Description "foobar", Lenient] :: Symbol
54+-- = "foobar"
55+--
56+type FoldDescription mods = FoldDescription' "" mods
57+
58+-- | Implementation of 'FoldDescription'.
59+type family FoldDescription' (acc :: Symbol) (mods :: [*]) :: Symbol where
60+ FoldDescription' acc '[] = acc
61+ FoldDescription' acc (Description desc ': mods) = FoldDescription' desc mods
62+ FoldDescription' acc (mod ': mods) = FoldDescription' acc mods
63+
64+-- | Reflect description to the term level.
65+--
66+-- >>> reflectDescription (Proxy :: Proxy '[Required, Description "foobar", Lenient])
67+-- "foobar"
68+--
69+reflectDescription :: forall mods. KnownSymbol (FoldDescription mods) => Proxy mods -> String
70+reflectDescription _ = symbolVal (Proxy :: Proxy (FoldDescription mods))
71+
32-- $setup
72-- $setup
33-- >>> import Servant.API
73-- >>> import Servant.API
34-- >>> import Data.Aeson
74-- >>> import Data.Aeson
servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs+1−1
@@ -22,7 +22,7 @@ comprehensiveAPI = Proxy
22type ComprehensiveAPIWithoutRaw =
22type ComprehensiveAPIWithoutRaw =
23 GET :<|>
23 GET :<|>
24 Get '[JSON] Int :<|>
24 Get '[JSON] Int :<|>
25− Capture "foo" Int :> GET :<|>
25+ Capture' '[Description "example description"] "foo" Int :> GET :<|>
26 Header "foo" Int :> GET :<|>
26 Header "foo" Int :> GET :<|>
27 Header' '[Required, Lenient] "bar" Int :> GET :<|>
27 Header' '[Required, Lenient] "bar" Int :> GET :<|>
28 HttpVersion :> GET :<|>
28 HttpVersion :> GET :<|>
servant/src/Servant/Utils/Links.hs+4−4
@@ -101,7 +101,7 @@ module Servant.Utils.Links (
101) where
101) where
102
102
103import Data.List
103import Data.List
104−import Data.Monoid.Compat ( (<>) )
104+import Data.Semigroup ((<>))
105import Data.Proxy ( Proxy(..) )
105import Data.Proxy ( Proxy(..) )
106import Data.Singletons.Bool ( SBool (..), SBoolI (..) )
106import Data.Singletons.Bool ( SBool (..), SBoolI (..) )
107import qualified Data.Text as Text
107import qualified Data.Text as Text
@@ -115,7 +115,7 @@ import Prelude.Compat
115import Web.HttpApiData
115import Web.HttpApiData
116import Servant.API.Alternative ( (:<|>)((:<|>)) )
116import Servant.API.Alternative ( (:<|>)((:<|>)) )
117import Servant.API.BasicAuth ( BasicAuth )
117import Servant.API.BasicAuth ( BasicAuth )
118−import Servant.API.Capture ( Capture, CaptureAll )
118+import Servant.API.Capture ( Capture', CaptureAll )
119import Servant.API.ReqBody ( ReqBody' )
119import Servant.API.ReqBody ( ReqBody' )
120import Servant.API.QueryParam ( QueryParam', QueryParams, QueryFlag )
120import Servant.API.QueryParam ( QueryParam', QueryParams, QueryFlag )
121import Servant.API.Header ( Header' )
121import Servant.API.Header ( Header' )
@@ -336,8 +336,8 @@ instance HasLink sub => HasLink (ReqBody' mods ct a :> sub) where
336 toLink _ = toLink (Proxy :: Proxy sub)
336 toLink _ = toLink (Proxy :: Proxy sub)
337
337
338instance (ToHttpApiData v, HasLink sub)
338instance (ToHttpApiData v, HasLink sub)
339− => HasLink (Capture sym v :> sub) where
339+ => HasLink (Capture' mods sym v :> sub) where
340− type MkLink (Capture sym v :> sub) = v -> MkLink sub
340+ type MkLink (Capture' mods sym v :> sub) = v -> MkLink sub
341 toLink _ l v =
341 toLink _ l v =
342 toLink (Proxy :: Proxy sub) $
342 toLink (Proxy :: Proxy sub) $
343 addSegment (escaped . Text.unpack $ toUrlPiece v) l
343 addSegment (escaped . Text.unpack $ toUrlPiece v) l