git.iko.soy/typeable/servant
on 7176917 help sign in
31 files changed+339−147
since splitsnapshots
unifiedsplit
.travis.yml+10−22 cabal.make-travis-yml+1−1 cabal.project+21−2 doc/cookbook/file-upload/file-upload.cabal+1−1 doc/cookbook/https/https.cabal+1−1 doc/cookbook/structuring-apis/structuring-apis.cabal+1−1 doc/cookbook/using-custom-monad/using-custom-monad.cabal+1−1 doc/tutorial/tutorial.cabal+6−5 servant-client-core/CHANGELOG.md+8 servant-client-core/servant-client-core.cabal+13−11 servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+3−3 servant-client-ghcjs/servant-client-ghcjs.cabal+4−4 servant-client/CHANGELOG.md+11 servant-client/servant-client.cabal+17−15 servant-docs/CHANGELOG.md+7 servant-docs/servant-docs.cabal+13−11 servant-docs/src/Servant/Docs/Internal.hs+1−1 servant-foreign/CHANGELOG.md+8−1 servant-foreign/servant-foreign.cabal+14−9 servant-foreign/src/Servant/Foreign/Internal.hs+5−4 servant-server/CHANGELOG.md+8 servant-server/servant-server.cabal+17−15 servant-server/src/Servant/Server/Internal.hs+7−7 servant-server/src/Servant/Server/Internal/RoutingApplication.hs+15−7 servant/CHANGELOG.md+77 servant/servant.cabal+14−12 servant/src/Servant/API.hs+1−1 servant/src/Servant/API/Capture.hs+5−3 servant/src/Servant/API/Description.hs+45−5 servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs+1−1 servant/src/Servant/Utils/Links.hs+3−3
.travis.yml+10−22
@@ -14,6 +14,7 @@ branches:
1414 only:
1515 - master
1616 - release-0.12
17+ - release-0.13
1718
1819cache:
1920 directories:
@@ -45,6 +46,9 @@ matrix:
4546 - compiler: "ghc-8.2.2"
4647 # env: TEST=--disable-tests BENCH=--disable-benchmarks
4748 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]}}
4852
4953before_install:
5054 - HC=${CC}
@@ -69,9 +73,9 @@ install:
6973 - rm -fv cabal.project cabal.project.local
7074 - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
7175 - 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"
7377 - "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"
7579 - cat cabal.project
7680 - if [ -f "servant/configure.ac" ]; then
7781 (cd "servant" && autoreconf -i);
@@ -94,18 +98,6 @@ install:
9498 - if [ -f "doc/tutorial/configure.ac" ]; then
9599 (cd "doc/tutorial" && autoreconf -i);
96100 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
109101 - if [ -f "doc/cookbook/https/configure.ac" ]; then
110102 (cd "doc/cookbook/https" && autoreconf -i);
111103 fi
@@ -119,7 +111,7 @@ install:
119111 (cd "doc/cookbook/file-upload" && autoreconf -i);
120112 fi
121113 - 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
123115 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
124116
125117# Here starts the actual work to be performed for the package under test;
@@ -134,22 +126,18 @@ script:
134126 - (cd "servant-foreign" && cabal sdist)
135127 - (cd "servant-server" && cabal sdist)
136128 - (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)
141129 - (cd "doc/cookbook/https" && cabal sdist)
142130 - (cd "doc/cookbook/structuring-apis" && cabal sdist)
143131 - (cd "doc/cookbook/using-custom-monad" && cabal sdist)
144132 - (cd "doc/cookbook/file-upload" && cabal sdist)
145133 - echo -en 'travis_fold:end:sdist\\r'
146134 - 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}/
148136 - cd ${DISTDIR} || false
149137 - 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"
151139 - "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"
153141 - cat cabal.project
154142 - echo -en 'travis_fold:end:unpack\\r'
155143
cabal.make-travis-yml+1−1
@@ -1,5 +1,5 @@
11folds: all-but-test
2−branches: master release-0.12
2+branches: master release-0.12 release-0.13
33
44-- We have inplace packages (servant-js) so we skip installing dependencies in a separate step
55install-dependencies-step: False
cabal.project+21−2
@@ -5,9 +5,28 @@ packages: servant/
55 servant-foreign/
66 servant-server/
77 doc/tutorial/
8− doc/cookbook/*/*.cabal
98
10−allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens
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,
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
1130
1231constraints:
1332 -- 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
88maintainer: haskell-servant-maintainers@googlegroups.com
99build-type: Simple
1010cabal-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
1212
1313executable cookbook-file-upload
1414 main-is: FileUpload.lhs
doc/cookbook/https/https.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
88maintainer: haskell-servant-maintainers@googlegroups.com
99build-type: Simple
1010cabal-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
1212
1313executable cookbook-https
1414 main-is: Https.lhs
doc/cookbook/structuring-apis/structuring-apis.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
88maintainer: haskell-servant-maintainers@googlegroups.com
99build-type: Simple
1010cabal-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
1212
1313executable cookbook-structuring-apis
1414 main-is: StructuringApis.lhs
doc/cookbook/using-custom-monad/using-custom-monad.cabal+1−1
@@ -8,7 +8,7 @@ author: Servant Contributors
88maintainer: haskell-servant-maintainers@googlegroups.com
99build-type: Simple
1010cabal-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
1212
1313executable cookbook-using-custom-monad
1414 main-is: UsingCustomMonad.lhs
doc/tutorial/tutorial.cabal+6−5
@@ -13,10 +13,11 @@ maintainer: haskell-servant-maintainers@googlegroups.com
1313build-type: Simple
1414cabal-version: >=1.10
1515tested-with:
16− GHC==7.8.4
17− GHC==7.10.3
18− GHC==8.0.2
19− GHC==8.2.2
16+ GHC==7.8.4,
17+ GHC==7.10.3,
18+ GHC==8.0.2,
19+ GHC==8.2.2,
20+ GHC==8.4.1
2021extra-source-files:
2122 static/index.html
2223 static/ui.js
@@ -34,7 +35,7 @@ library
3435 -- Packages `servant` depends on.
3536 -- We don't need to specify bounds here as this package is never released.
3637 build-depends:
37− base >= 4.7 && <4.11
38+ base >= 4.7 && <4.12
3839 , aeson
3940 , aeson-compat
4041 , attoparsec
servant-client-core/CHANGELOG.md+8
@@ -1,6 +1,14 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client-core/CHANGELOG.md)
22[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
33
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+
4120.12
513----
614
servant-client-core/servant-client-core.cabal+13−11
@@ -1,5 +1,6 @@
11name: servant-client-core
2−version: 0.12
2+version: 0.13
3+x-revision: 1
34synopsis: Core functionality and class for client function generation for servant APIs
45description:
56 This library provides backend-agnostic generation of client functions. For
@@ -19,10 +20,11 @@ extra-source-files:
1920 CHANGELOG.md
2021 README.md
2122tested-with:
22− GHC==7.8.4
23− GHC==7.10.3
24− GHC==8.0.2
25− GHC==8.2.2
23+ GHC==7.8.4,
24+ GHC==7.10.3,
25+ GHC==8.0.2,
26+ GHC==8.2.2,
27+ GHC==8.4.1
2628
2729source-repository head
2830 type: git
@@ -45,7 +47,7 @@ library
4547 --
4648 -- note: mtl lower bound is so low because of GHC-7.8
4749 build-depends:
48− base >= 4.7 && < 4.11
50+ base >= 4.7 && < 4.12
4951 , bytestring >= 0.10.4.0 && < 0.11
5052 , containers >= 0.5.5.1 && < 0.6
5153 , mtl >= 2.1 && < 2.3
@@ -57,17 +59,17 @@ library
5759
5860 -- Servant dependencies
5961 build-depends:
60− servant == 0.12.*
62+ servant == 0.13.*
6163
6264 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6365 -- Here can be exceptions if we really need features from the newer versions.
6466 build-depends:
6567 base-compat >= 0.9.3 && < 0.10
6668 , base64-bytestring >= 1.0.0.1 && < 1.1
67− , exceptions >= 0.8.3 && < 0.9
69+ , exceptions >= 0.8.3 && < 0.11
6870 , generics-sop >= 0.3.1.0 && < 0.4
6971 , http-api-data >= 0.3.7.1 && < 0.4
70− , http-media >= 0.7.1.1 && < 0.8
72+ , http-media >= 0.7.0 && < 0.8
7173 , http-types >= 0.12 && < 0.13
7274 , network-uri >= 2.6.1.0 && < 2.7
7375 , safe >= 0.3.15 && < 0.4
@@ -95,8 +97,8 @@ test-suite spec
9597 -- Additonal dependencies
9698 build-depends:
9799 deepseq >= 1.3.0.2 && <1.5
98− , hspec >= 2.4.4 && <2.5
100+ , hspec >= 2.4.4 && <2.6
99101 , QuickCheck >= 2.10.1 && < 2.12
100102
101103 build-tool-depends:
102− hspec-discover:hspec-discover >= 2.4.4 && <2.5
104+ hspec-discover:hspec-discover >= 2.4.4 && <2.6
servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+3−3
@@ -34,7 +34,7 @@ import Servant.API ((:<|>) ((:<|>)), (:>),
3434 BuildHeadersTo (..),
3535 BuildFromStream (..),
3636 ByteStringParser (..),
37− Capture, CaptureAll,
37+ Capture', CaptureAll,
3838 Description, EmptyAPI,
3939 FramingUnrender (..),
4040 Header', Headers (..),
@@ -155,9 +155,9 @@ instance RunClient m => HasClient m EmptyAPI where
155155-- > getBook = client myApi
156156-- > -- then you can just use "getBook" to query that endpoint
157157instance (KnownSymbol capture, ToHttpApiData a, HasClient m api)
158− => HasClient m (Capture capture a :> api) where
158+ => HasClient m (Capture' mods capture a :> api) where
159159
160− type Client m (Capture capture a :> api) =
160+ type Client m (Capture' mods capture a :> api) =
161161 a -> Client m api
162162
163163 clientWithRoute pm Proxy req val =
servant-client-ghcjs/servant-client-ghcjs.cabal+4−4
@@ -1,5 +1,5 @@
11name: servant-client-ghcjs
2−version: 0.11
2+version: 0.13
33synopsis: automatical derivation of querying functions for servant webservices for ghcjs
44description:
55 This library lets you automatically derive Haskell functions that
@@ -31,11 +31,11 @@ library
3131 Servant.Client.Ghcjs
3232 Servant.Client.Internal.XhrClient
3333 build-depends:
34− base >= 4.7 && < 4.11
34+ base >= 4.7 && < 4.12
3535 , bytestring >= 0.10 && < 0.11
3636 , case-insensitive >= 1.2.0.0 && < 1.3.0.0
3737 , containers >= 0.5 && < 0.6
38− , exceptions >= 0.8 && < 0.9
38+ , exceptions >= 0.8 && < 0.11
3939 , ghcjs-base >= 0.2.0.0 && < 0.3.0.0
4040 , ghcjs-prim >= 0.1.0.0 && < 0.2.0.0
4141 , http-media >= 0.6.2 && < 0.8
@@ -43,7 +43,7 @@ library
4343 , monad-control >= 1.0.0.4 && < 1.1
4444 , mtl >= 2.1 && < 2.3
4545 , semigroupoids >= 4.3 && < 5.3
46− , servant-client-core >= 0.12 && < 0.13
46+ , servant-client-core == 0.13.*
4747 , string-conversions >= 0.3 && < 0.5
4848 , transformers >= 0.3 && < 0.6
4949 , transformers-base >= 0.4.4 && < 0.5
servant-client/CHANGELOG.md+11
@@ -1,6 +1,17 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client/CHANGELOG.md)
22[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
33
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+
4150.12.0.1
516--------
617
servant-client/servant-client.cabal+17−15
@@ -1,5 +1,6 @@
11name: servant-client
2−version: 0.12.0.1
2+version: 0.13
3+x-revision: 1
34synopsis: automatical derivation of querying functions for servant webservices
45description:
56 This library lets you derive automatically Haskell functions that
@@ -17,10 +18,11 @@ category: Servant, Web
1718build-type: Simple
1819cabal-version: >=1.10
1920tested-with:
20− GHC==7.8.4
21− GHC==7.10.3
22− GHC==8.0.2
23− GHC==8.2.2
21+ GHC==7.8.4,
22+ GHC==7.10.3,
23+ GHC==8.0.2,
24+ GHC==8.2.2,
25+ GHC==8.4.1
2426homepage: http://haskell-servant.readthedocs.org/
2527Bug-reports: http://github.com/haskell-servant/servant/issues
2628extra-source-files:
@@ -41,7 +43,7 @@ library
4143 --
4244 -- note: mtl lower bound is so low because of GHC-7.8
4345 build-depends:
44− base >= 4.7 && < 4.11
46+ base >= 4.7 && < 4.12
4547 , bytestring >= 0.10.4.0 && < 0.11
4648 , containers >= 0.5.5.1 && < 0.6
4749 , mtl >= 2.1 && < 2.3
@@ -54,24 +56,24 @@ library
5456
5557 -- Servant dependencies
5658 build-depends:
57− servant-client-core == 0.12.*
59+ servant-client-core == 0.13.*
5860
5961 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6062 -- Here can be exceptions if we really need features from the newer versions.
6163 build-depends:
62− aeson >= 1.2.3.0 && < 1.3
64+ aeson >= 1.2.3.0 && < 1.4
6365 , base-compat >= 0.9.3 && < 0.10
6466 , attoparsec >= 0.13.2.0 && < 0.14
6567 , http-client >= 0.5.7.1 && < 0.6
6668 , 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
6870 , http-types >= 0.12 && < 0.13
69− , exceptions >= 0.8.3 && < 0.9
71+ , exceptions >= 0.8.3 && < 0.11
7072 , monad-control >= 1.0.0.4 && < 1.1
7173 , semigroupoids >= 5.2.1 && < 5.3
7274 , stm >= 2.4.4.1 && < 2.5
7375 , transformers-base >= 0.4.4 && < 0.5
74− , transformers-compat >= 0.5.1 && < 0.6
76+ , transformers-compat >= 0.5.1 && < 0.7
7577
7678 hs-source-dirs: src
7779 default-language: Haskell2010
@@ -114,12 +116,12 @@ test-suite spec
114116 build-depends:
115117 deepseq >= 1.3.0.2 && < 1.5
116118 , generics-sop >= 0.3.1.0 && < 0.4
117− , hspec >= 2.4.4 && < 2.5
119+ , hspec >= 2.4.4 && < 2.6
118120 , HUnit >= 1.6 && < 1.7
119121 , network >= 2.6.3.2 && < 2.7
120122 , QuickCheck >= 2.10.1 && < 2.12
121− , servant == 0.12.*
122− , servant-server == 0.12.*
123+ , servant == 0.13.*
124+ , servant-server == 0.13.*
123125
124126 build-tool-depends:
125− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
127+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
servant-docs/CHANGELOG.md+7
@@ -1,6 +1,13 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md)
22[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
33
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+
4110.11.1
512------
613
servant-docs/servant-docs.cabal+13−11
@@ -1,5 +1,6 @@
11name: servant-docs
2−version: 0.11.1
2+version: 0.11.2
3+x-revision: 1
34synopsis: generate API docs for your servant webservice
45description:
56 Library for generating API docs from a servant API definition.
@@ -16,10 +17,11 @@ category: Servant, Web
1617build-type: Simple
1718cabal-version: >=1.10
1819tested-with:
19− GHC==7.8.4
20− GHC==7.10.3
21− GHC==8.0.2
22− GHC==8.2.2
20+ GHC==7.8.4,
21+ GHC==7.10.3,
22+ GHC==8.0.2,
23+ GHC==8.2.2,
24+ GHC==8.4.1
2325homepage: http://haskell-servant.readthedocs.org/
2426Bug-reports: http://github.com/haskell-servant/servant/issues
2527extra-source-files:
@@ -41,7 +43,7 @@ library
4143 --
4244 -- note: mtl lower bound is so low because of GHC-7.8
4345 build-depends:
44− base >= 4.7 && < 4.11
46+ base >= 4.7 && < 4.12
4547 , bytestring >= 0.10.4.0 && < 0.11
4648 , text >= 1.2.3.0 && < 1.3
4749
@@ -51,18 +53,18 @@ library
5153
5254 -- Servant dependencies
5355 build-depends:
54− servant == 0.12.*
56+ servant == 0.13.*
5557
5658 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5759 -- Here can be exceptions if we really need features from the newer versions.
5860 build-depends:
59− aeson >= 1.2.3.0 && < 1.3
61+ aeson >= 1.2.3.0 && < 1.4
6062 , aeson-pretty >= 0.8.5 && < 0.9
6163 , base-compat >= 0.9.3 && < 0.10
6264 , case-insensitive >= 1.2.0.10 && < 1.3
6365 , control-monad-omega >= 0.3.1 && < 0.4
6466 , hashable >= 1.2.6.1 && < 1.3
65− , http-media >= 0.7.1.1 && < 0.8
67+ , http-media >= 0.7.0 && < 0.8
6668 , http-types >= 0.12 && < 0.13
6769 , lens >= 4.15.4 && < 4.17
6870 , string-conversions >= 0.4.0.1 && < 0.5
@@ -108,7 +110,7 @@ test-suite spec
108110
109111 -- Additonal dependencies
110112 build-depends:
111− hspec >= 2.4.4 && < 2.5
113+ hspec >= 2.4.4 && < 2.6
112114
113115 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
795795-- | @"books" :> 'Capture' "isbn" Text@ will appear as
796796-- @/books/:isbn@ in the docs.
797797instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
798− => HasDocs (Capture sym a :> api) where
798+ => HasDocs (Capture' mods sym a :> api) where
799799
800800 docsFor Proxy (endpoint, action) =
801801 docsFor subApiP (endpoint', action')
servant-foreign/CHANGELOG.md+8−1
@@ -1,12 +1,19 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-foreign/CHANGELOG.md)
22[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
33
4+0.11.1
5+------
6+
7+- Add missing `Semigroup` instances
8+
490.11
510----
611
712### Breaking changes
813
9−* Make foreign client Header arguments have the representation of 'Maybe' in those languages
14+- *servant* Add `Servant.API.Modifiers`
15+ ([#873](https://github.com/haskell-servant/servant/pull/873))
16+- Make foreign client Header arguments have the representation of 'Maybe' in those languages
1017 ([#843](https://github.com/haskell-servant/servant/pull/843))
1118
12190.10.2
servant-foreign/servant-foreign.cabal+14−9
@@ -1,5 +1,5 @@
11name: servant-foreign
2−version: 0.11
2+version: 0.11.1
33synopsis: Helpers for generating clients for servant APIs in any programming language
44description:
55 Helper types and functions for generating client functions for servant APIs in any programming language
@@ -23,10 +23,11 @@ extra-source-files:
2323 README.md
2424bug-reports: http://github.com/haskell-servant/servant/issues
2525tested-with:
26− GHC==7.8.4
27− GHC==7.10.3
28− GHC==8.0.2
29− GHC==8.2.2
26+ GHC==7.8.4,
27+ GHC==7.10.3,
28+ GHC==8.0.2,
29+ GHC==8.2.2,
30+ GHC==8.4.1
3031
3132source-repository head
3233 type: git
@@ -42,12 +43,16 @@ library
4243 --
4344 -- note: mtl lower bound is so low because of GHC-7.8
4445 build-depends:
45− base >= 4.7 && <4.11
46+ base >= 4.7 && <4.12
4647 , text >= 1.2.3.0 && < 1.3
4748
49+ if !impl(ghc >= 8.0)
50+ build-depends:
51+ semigroups >=0.18.3 && <0.19
52+
4853 -- Servant dependencies
4954 build-depends:
50− servant == 0.12.*
55+ servant == 0.13.*
5156
5257 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5358 -- Here can be exceptions if we really need features from the newer versions.
@@ -79,8 +84,8 @@ test-suite spec
7984
8085 -- Additonal dependencies
8186 build-depends:
82− hspec >= 2.4.4 && <2.5
87+ hspec >= 2.4.4 && <2.6
8388
8489 build-tool-depends:
85− hspec-discover:hspec-discover >=2.4.4 && <2.5
90+ hspec-discover:hspec-discover >=2.4.4 && <2.6
8691 default-language: Haskell2010
servant-foreign/src/Servant/Foreign/Internal.hs+5−4
@@ -27,6 +27,7 @@ import Control.Lens (makePrisms, makeLenses, Getter, (&), (<>~), (%~),
2727 (.~))
2828import Data.Data (Data)
2929import Data.Proxy
30+import Data.Semigroup (Semigroup)
3031import Data.String
3132import Data.Text
3233import Data.Typeable (Typeable)
@@ -38,12 +39,12 @@ import Servant.API.TypeLevel
3839import Servant.API.Modifiers (RequiredArgument)
3940
4041newtype FunctionName = FunctionName { unFunctionName :: [Text] }
41− deriving (Data, Show, Eq, Monoid, Typeable)
42+ deriving (Data, Show, Eq, Semigroup, Monoid, Typeable)
4243
4344makePrisms ''FunctionName
4445
4546newtype PathSegment = PathSegment { unPathSegment :: Text }
46− deriving (Data, Show, Eq, IsString, Monoid, Typeable)
47+ deriving (Data, Show, Eq, IsString, Semigroup, Monoid, Typeable)
4748
4849makePrisms ''PathSegment
4950
@@ -195,8 +196,8 @@ instance HasForeign lang ftype EmptyAPI where
195196 foreignFor Proxy Proxy Proxy _ = EmptyForeignAPI
196197
197198instance (KnownSymbol sym, HasForeignType lang ftype t, HasForeign lang ftype api)
198− => HasForeign lang ftype (Capture sym t :> api) where
199− type Foreign ftype (Capture sym t :> api) = Foreign ftype api
199+ => HasForeign lang ftype (Capture' mods sym t :> api) where
200+ type Foreign ftype (Capture' mods sym t :> api) = Foreign ftype api
200201
201202 foreignFor lang Proxy Proxy req =
202203 foreignFor lang Proxy (Proxy :: Proxy api) $
servant-server/CHANGELOG.md+8
@@ -1,6 +1,14 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-server/CHANGELOG.md)
22[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
33
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+
4120.12
513----
614
servant-server/servant-server.cabal+17−15
@@ -1,5 +1,6 @@
11name: servant-server
2−version: 0.12
2+version: 0.13
3+x-revision: 1
34synopsis: A family of combinators for defining webservices APIs and serving them
45description:
56 A family of combinators for defining webservices APIs and serving them
@@ -22,10 +23,11 @@ category: Servant, Web
2223build-type: Custom
2324cabal-version: >=1.10
2425tested-with:
25− GHC==7.8.4
26− GHC==7.10.3
27− GHC==8.0.2
28− GHC==8.2.2
26+ GHC==7.8.4,
27+ GHC==7.10.3,
28+ GHC==8.0.2,
29+ GHC==8.2.2,
30+ GHC==8.4.1
2931extra-source-files:
3032 include/*.h
3133 CHANGELOG.md
@@ -60,7 +62,7 @@ library
6062 --
6163 -- note: mtl lower bound is so low because of GHC-7.8
6264 build-depends:
63− base >= 4.7 && < 4.11
65+ base >= 4.7 && < 4.12
6466 , bytestring >= 0.10.4.0 && < 0.11
6567 , containers >= 0.5.5.1 && < 0.6
6668 , mtl >= 2.1 && < 2.3
@@ -70,18 +72,18 @@ library
7072
7173 -- Servant dependencies
7274 build-depends:
73− servant == 0.12.*
75+ servant == 0.13.*
7476
7577 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
7678 -- Here can be exceptions if we really need features from the newer versions.
7779 build-depends:
78− aeson >= 1.2.3.0 && < 1.3
80+ aeson >= 1.2.3.0 && < 1.4
7981 , base-compat >= 0.9.3 && < 0.10
8082 , attoparsec >= 0.13.2.0 && < 0.14
8183 , base64-bytestring >= 1.0.0.1 && < 1.1
82− , exceptions >= 0.8.3 && < 0.9
84+ , exceptions >= 0.8.3 && < 0.11
8385 , http-api-data >= 0.3.7.1 && < 0.4
84− , http-media >= 0.7.1.1 && < 0.8
86+ , http-media >= 0.7.0 && < 0.8
8587 , http-types >= 0.12 && < 0.13
8688 , network-uri >= 2.6.1.0 && < 2.7
8789 , monad-control >= 1.0.0.4 && < 1.1
@@ -90,10 +92,10 @@ library
9092 , split >= 0.2.3.2 && < 0.3
9193 , string-conversions >= 0.4.0.1 && < 0.5
9294 , system-filepath >= 0.4 && < 0.5
93− , resourcet >= 1.1.10 && < 1.2
95+ , resourcet >= 1.1.9 && < 1.3
9496 , tagged >= 0.8.5 && < 0.9
9597 , transformers-base >= 0.4.4 && < 0.5
96− , transformers-compat >= 0.5.1 && < 0.6
98+ , transformers-compat >= 0.5.1 && < 0.7
9799 , wai >= 3.2.1.1 && < 3.3
98100 , wai-app-static >= 3.1.6.1 && < 3.2
99101 , warp >= 3.2.13 && < 3.3
@@ -164,7 +166,7 @@ test-suite spec
164166 -- Additonal dependencies
165167 build-depends:
166168 directory >= 1.2.1.0 && < 1.4
167− , hspec >= 2.4.4 && < 2.5
169+ , hspec >= 2.4.4 && < 2.6
168170 , hspec-wai >= 0.9 && < 0.10
169171 , should-not-typecheck >= 2.1.0 && < 2.2
170172 , parsec >= 3.1.11 && < 3.2
@@ -173,13 +175,13 @@ test-suite spec
173175 , temporary >= 1.2.0.3 && < 1.3
174176
175177 build-tool-depends:
176− hspec-discover:hspec-discover >=2.4.4 && <2.5
178+ hspec-discover:hspec-discover >=2.4.4 && <2.6
177179
178180test-suite doctests
179181 build-depends:
180182 base
181183 , servant-server
182− , doctest >= 0.13.0 && <0.14
184+ , doctest >= 0.13.0 && <0.16
183185 type: exitcode-stdio-1.0
184186 main-is: test/doctests.hs
185187 buildable: True
servant-server/src/Servant/Server/Internal.hs+7−7
@@ -67,7 +67,7 @@ import Web.HttpApiData (FromHttpApiData, parseHeader,
6767 parseQueryParam,
6868 parseUrlPieceMaybe,
6969 parseUrlPieces)
70−import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture,
70+import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture',
7171 CaptureAll, Verb, EmptyAPI,
7272 ReflectMethod(reflectMethod),
7373 IsSecure(..), Header', QueryFlag,
@@ -164,9 +164,9 @@ instance (HasServer a context, HasServer b context) => HasServer (a :<|> b) cont
164164-- > where getBook :: Text -> Handler Book
165165-- > getBook isbn = ...
166166instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
167− => HasServer (Capture capture a :> api) context where
167+ => HasServer (Capture' mods capture a :> api) context where
168168
169− type ServerT (Capture capture a :> api) m =
169+ type ServerT (Capture' mods capture a :> api) m =
170170 a -> ServerT api m
171171
172172 hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
@@ -749,14 +749,14 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
749749-- ...
750750-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
751751-- ...Maybe you haven't applied enough arguments to
752−-- ...Capture "foo"
752+-- ...Capture' '[] "foo"
753753-- ...
754754--
755755-- >>> undefined :: Server (Capture "foo" :> Get '[JSON] Int)
756756-- ...
757757-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
758758-- ...Maybe you haven't applied enough arguments to
759−-- ...Capture "foo"
759+-- ...Capture' '[] "foo"
760760-- ...
761761--
762762instance TypeError (HasServerArrowKindError arr) => HasServer ((arr :: k -> l) :> api) context
@@ -778,7 +778,7 @@ type HasServerArrowKindError arr =
778778-- ...
779779-- ...No instance HasServer (a -> b).
780780-- ...Maybe you have used '->' instead of ':>' between
781−-- ...Capture "foo" Int
781+-- ...Capture' '[] "foo" Int
782782-- ...and
783783-- ...Verb 'GET 200 '[JSON] Int
784784-- ...
@@ -787,7 +787,7 @@ type HasServerArrowKindError arr =
787787-- ...
788788-- ...No instance HasServer (a -> b).
789789-- ...Maybe you have used '->' instead of ':>' between
790−-- ...Capture "foo" Int
790+-- ...Capture' '[] "foo" Int
791791-- ...and
792792-- ...Verb 'GET 200 '[JSON] Int
793793-- ...
servant-server/src/Servant/Server/Internal/RoutingApplication.hs+15−7
@@ -13,11 +13,11 @@ module Servant.Server.Internal.RoutingApplication where
1313import Control.Monad (ap, liftM)
1414import Control.Monad.Base (MonadBase (..))
1515import Control.Monad.Catch (MonadThrow (..))
16−import Control.Monad.Reader (MonadReader (..), ReaderT, runReaderT)
16+import Control.Monad.Reader (MonadReader (..), ReaderT (..), runReaderT)
1717import Control.Monad.Trans (MonadIO (..), MonadTrans (..))
1818import Control.Monad.Trans.Control (ComposeSt, MonadBaseControl (..), MonadTransControl (..),
1919 defaultLiftBaseWith, defaultRestoreM)
20−import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT)
20+import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT, withInternalState, runInternalState)
2121import Network.Wai (Application, Request, Response, ResponseReceived)
2222import Prelude ()
2323import Prelude.Compat
@@ -84,7 +84,6 @@ instance MonadTransControl RouteResultT where
8484instance MonadThrow m => MonadThrow (RouteResultT m) where
8585 throwM = lift . throwM
8686
87−
8887toApplication :: RoutingApplication -> Application
8988toApplication ra request respond = ra request routingRespond
9089 where
@@ -194,18 +193,27 @@ newtype DelayedIO a = DelayedIO { runDelayedIO' :: ReaderT Request (ResourceT (R
194193 deriving
195194 ( Functor, Applicative, Monad
196195 , MonadIO, MonadReader Request
197− , MonadBase IO
198196 , MonadThrow
199197 , MonadResource
200198 )
201199
200+instance MonadBase IO DelayedIO where
201+ liftBase = liftIO
202+
202203liftRouteResult :: RouteResult a -> DelayedIO a
203204liftRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
204205
205206instance MonadBaseControl IO DelayedIO where
206− type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
207− liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
208− restoreM = DelayedIO . restoreM
207+ -- type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
208+ -- liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
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+
209217
210218runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a)
211219runDelayedIO m req = transResourceT runRouteResultT $ runReaderT (runDelayedIO' m) req
servant/CHANGELOG.md+77
@@ -1,5 +1,82 @@
11[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
22
3+0.13
4+----
5+
6+### Significant changes
7+
8+- Streaming endpoint support.
9+ ([#836](https://github.com/haskell-servant/servant/pull/836))
10+
11+ ```haskell
12+ type StreamApi f = "streamGetNewline" :> StreamGet NewlineFraming JSON (f Person)
13+ ```
14+
15+ See tutorial for more details
16+ - [A web API as a type - StreamGet and StreamPost](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/ApiType.html#streamget-and-streampost)
17+ - [Serving an API - streaming endpoints](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Server.html#streaming-endpoints)
18+ - [Querying an API - Querying Streaming APIs](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Client.html#querying-streaming-apis)
19+
20+- *servant* Add `Servant.API.Modifiers`
21+ ([#873](https://github.com/haskell-servant/servant/pull/873)
22+ [#903](https://github.com/haskell-servant/servant/pull/903))
23+
24+ `QueryParam`, `Header` and `ReqBody` understand modifiers:
25+ - `Required` or `Optional` (resulting in `a` or `Maybe a` in handlers)
26+ - `Strict` or `Lenient` (resulting in `a` or `Either String a` in handlers)
27+
28+ Also you can use `Description` as a modifier, but it doesn't yet work
29+ with `servant-docs`, only `servant-swagger`. [There is an issue.](https://github.com/haskell-servant/servant/issues/902)
30+
31+- *servant-client* Support `http-client`’s `CookieJar`
32+ ([#897](https://github.com/haskell-servant/servant/pull/897)
33+ [#883](https://github.com/haskell-servant/servant/pull/883))
34+
35+ `ClientM` preserves cookies between requests,
36+ if given initial `CookieJar`.
37+ To migrate from older code, change `ClientEnv` constructor
38+ to `mkClientEnv` which makes `ClientEnv` without `CookieJar`.
39+
40+- *servant* Mono-kind-ise modifiers, resulting in better error messages.
41+ ([#887](https://github.com/haskell-servant/servant/issues/887)
42+ [#890](https://github.com/haskell-servant/servant/pull/890))
43+
44+- *servant* Add `TypeError ... => HasServer`s instances in GHC-8.2 for
45+ not saturated modifiers (`Capture "foo" :> ...`) or `->` in place of `:>`.
46+ ([#893](https://github.com/haskell-servant/servant/pull/893))
47+
48+- *Cookbook* example projects at
49+ http://haskell-servant.readthedocs.io/en/master/cookbook/index.html
50+ ([#867](https://github.com/haskell-servant/servant/pull/867)
51+ [#892](https://github.com/haskell-servant/servant/pull/882))
52+
53+- *Experimental work* `servant-client-ghcjs`
54+ ([#818](https://github.com/haskell-servant/servant/pull/818)
55+ [#869](https://github.com/haskell-servant/servant/pull/869))
56+
57+### Other changes
58+
59+- *servant* Links aren't double escaped
60+ ([#878](https://github.com/haskell-servant/servant/pull/878))
61+
62+- Dependency updates
63+ ([#900](https://github.com/haskell-servant/servant/pull/900)
64+ [#898](https://github.com/haskell-servant/servant/pull/898)
65+ [#895](https://github.com/haskell-servant/servant/pull/895)
66+ [#872](https://github.com/haskell-servant/servant/pull/872))
67+
68+- Documentation updates
69+ ([#875](https://github.com/haskell-servant/servant/pull/875)
70+ [#861](https://github.com/haskell-servant/servant/pull/861))
71+
72+- Refactorings
73+ ([#899](https://github.com/haskell-servant/servant/pull/899)
74+ [#896](https://github.com/haskell-servant/servant/pull/896)
75+ [#889](https://github.com/haskell-servant/servant/pull/889)
76+ [#891](https://github.com/haskell-servant/servant/pull/891)
77+ [#892](https://github.com/haskell-servant/servant/pull/892)
78+ [#885](https://github.com/haskell-servant/servant/pull/885))
79+
3800.12.1
481------
582
servant/servant.cabal+14−12
@@ -1,5 +1,6 @@
11name: servant
2−version: 0.12
2+version: 0.13
3+x-revision: 1
34synopsis: A family of combinators for defining webservices APIs
45description:
56 A family of combinators for defining webservices APIs and serving them
@@ -18,10 +19,11 @@ category: Servant, Web
1819build-type: Custom
1920cabal-version: >=1.10
2021tested-with:
21− GHC==7.8.4
22− GHC==7.10.3
23− GHC==8.0.2
24− GHC==8.2.2
22+ GHC==7.8.4,
23+ GHC==7.10.3,
24+ GHC==8.0.2,
25+ GHC==8.2.2,
26+ GHC==8.4.1
2527extra-source-files:
2628 include/*.h
2729 CHANGELOG.md
@@ -69,7 +71,7 @@ library
6971 --
7072 -- note: mtl lower bound is so low because of GHC-7.8
7173 build-depends:
72− base >= 4.7 && < 4.11
74+ base >= 4.7 && < 4.12
7375 , bytestring >= 0.10.4.0 && < 0.11
7476 , mtl >= 2.1 && < 2.3
7577 , text >= 1.2.3.0 && < 1.3
@@ -82,11 +84,11 @@ library
8284 -- Here can be exceptions if we really need features from the newer versions.
8385 build-depends:
8486 base-compat >= 0.9.3 && < 0.10
85− , aeson >= 1.2.3.0 && < 1.3
87+ , aeson >= 1.2.3.0 && < 1.4
8688 , attoparsec >= 0.13.2.0 && < 0.14
8789 , case-insensitive >= 1.2.0.10 && < 1.3
8890 , http-api-data >= 0.3.7.1 && < 0.4
89− , http-media >= 0.7.1.1 && < 0.8
91+ , http-media >= 0.7.0 && < 0.8
9092 , http-types >= 0.12 && < 0.13
9193 , natural-transformation >= 0.4 && < 0.5
9294 , mmorph >= 1.1.0 && < 1.2
@@ -153,22 +155,22 @@ test-suite spec
153155 -- Additonal dependencies
154156 build-depends:
155157 aeson-compat >= 0.3.3 && < 0.4
156− , hspec >= 2.4.4 && < 2.5
158+ , hspec >= 2.4.4 && < 2.6
157159 , QuickCheck >= 2.10.1 && < 2.12
158160 , quickcheck-instances >= 0.3.16 && < 0.4
159161
160162 build-tool-depends:
161− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
163+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
162164
163165test-suite doctests
164166 build-depends:
165167 base
166168 , servant
167− , doctest >= 0.13.0 && <0.14
169+ , doctest >= 0.13.0 && <0.16
168170
169171 -- We test Links failure with doctest, so we need extra dependencies
170172 build-depends:
171− hspec >= 2.4.4 && < 2.5
173+ hspec >= 2.4.4 && < 2.6
172174
173175 type: exitcode-stdio-1.0
174176 main-is: test/doctests.hs
servant/src/Servant/API.hs+1−1
@@ -74,7 +74,7 @@ module Servant.API (
7474
7575import Servant.API.Alternative ((:<|>) (..))
7676import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
77−import Servant.API.Capture (Capture, CaptureAll)
77+import Servant.API.Capture (Capture, Capture', CaptureAll)
7878import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
7979 JSON,
8080 MimeRender (..), NoContent (NoContent),
servant/src/Servant/API/Capture.hs+5−3
@@ -2,7 +2,7 @@
22{-# LANGUAGE DeriveDataTypeable #-}
33{-# LANGUAGE PolyKinds #-}
44{-# OPTIONS_HADDOCK not-home #-}
5−module Servant.API.Capture (Capture, CaptureAll) where
5+module Servant.API.Capture (Capture, Capture', CaptureAll) where
66
77import Data.Typeable (Typeable)
88import GHC.TypeLits (Symbol)
@@ -12,9 +12,11 @@ import GHC.TypeLits (Symbol)
1212--
1313-- >>> -- GET /books/:isbn
1414-- >>> type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book
15−data Capture (sym :: Symbol) (a :: *)
16− deriving (Typeable)
15+type Capture = Capture' '[] -- todo
1716
17+-- | 'Capture' which can be modified. For example with 'Description'.
18+data Capture' (mods :: [*]) (sym :: Symbol) (a :: *)
19+ deriving (Typeable)
1820
1921-- | Capture all remaining values from the request path under a certain type
2022-- @a@.
servant/src/Servant/API/Description.hs+45−5
@@ -1,11 +1,25 @@
1−{-# LANGUAGE DataKinds #-}
2−{-# LANGUAGE DeriveDataTypeable #-}
3−{-# LANGUAGE PolyKinds #-}
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE FlexibleContexts #-}
4+{-# LANGUAGE PolyKinds #-}
5+{-# LANGUAGE ScopedTypeVariables #-}
6+{-# LANGUAGE TypeOperators #-}
7+{-# LANGUAGE TypeFamilies #-}
48{-# 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
618
719import Data.Typeable (Typeable)
8−import GHC.TypeLits (Symbol)
20+import GHC.TypeLits (Symbol, KnownSymbol, symbolVal)
21+import Data.Proxy (Proxy (..))
22+
923-- | Add a short summary for (part of) API.
1024--
1125-- Example:
@@ -29,6 +43,32 @@ data Summary (sym :: Symbol)
2943data Description (sym :: Symbol)
3044 deriving (Typeable)
3145
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+
3272-- $setup
3373-- >>> import Servant.API
3474-- >>> import Data.Aeson
servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs+1−1
@@ -22,7 +22,7 @@ comprehensiveAPI = Proxy
2222type ComprehensiveAPIWithoutRaw =
2323 GET :<|>
2424 Get '[JSON] Int :<|>
25− Capture "foo" Int :> GET :<|>
25+ Capture' '[Description "example description"] "foo" Int :> GET :<|>
2626 Header "foo" Int :> GET :<|>
2727 Header' '[Required, Lenient] "bar" Int :> GET :<|>
2828 HttpVersion :> GET :<|>
servant/src/Servant/Utils/Links.hs+3−3
@@ -115,7 +115,7 @@ import Prelude.Compat
115115import Web.HttpApiData
116116import Servant.API.Alternative ( (:<|>)((:<|>)) )
117117import Servant.API.BasicAuth ( BasicAuth )
118−import Servant.API.Capture ( Capture, CaptureAll )
118+import Servant.API.Capture ( Capture', CaptureAll )
119119import Servant.API.ReqBody ( ReqBody' )
120120import Servant.API.QueryParam ( QueryParam', QueryParams, QueryFlag )
121121import Servant.API.Header ( Header' )
@@ -336,8 +336,8 @@ instance HasLink sub => HasLink (ReqBody' mods ct a :> sub) where
336336 toLink _ = toLink (Proxy :: Proxy sub)
337337
338338instance (ToHttpApiData v, HasLink sub)
339− => HasLink (Capture sym v :> sub) where
340− type MkLink (Capture sym v :> sub) = v -> MkLink sub
339+ => HasLink (Capture' mods sym v :> sub) where
340+ type MkLink (Capture' mods sym v :> sub) = v -> MkLink sub
341341 toLink _ l v =
342342 toLink (Proxy :: Proxy sub) $
343343 addSegment (escaped . Text.unpack $ toUrlPiece v) l