git.iko.soy/typeable/servant
on c34bd1c help sign in
27 files changed+290−110
since splitsnapshots
unifiedsplit
.travis.yml+7−22 cabal.make-travis-yml+1−1 cabal.project+24−2 doc/tutorial/tutorial.cabal+1−1 servant-client-core/CHANGELOG.md+8 servant-client-core/servant-client-core.cabal+6−6 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+10−10 servant-docs/CHANGELOG.md+7 servant-docs/servant-docs.cabal+6−6 servant-docs/src/Servant/Docs/Internal.hs+1−1 servant-foreign/CHANGELOG.md+8−1 servant-foreign/servant-foreign.cabal+9−5 servant-foreign/src/Servant/Foreign/Internal.hs+5−4 servant-server/CHANGELOG.md+8 servant-server/servant-server.cabal+10−10 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+7−7 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+7−22
@@ -14,6 +14,7 @@ branches:
1414 only:
1515 - master
1616 - release-0.12
17+ - release-0.13
1718
1819cache:
1920 directories:
@@ -69,9 +70,9 @@ install:
6970 - rm -fv cabal.project cabal.project.local
7071 - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
7172 - 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"
73+ - "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"
7374 - "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"
75+ - "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, http-media:base' >> cabal.project"
7576 - cat cabal.project
7677 - if [ -f "servant/configure.ac" ]; then
7778 (cd "servant" && autoreconf -i);
@@ -94,18 +95,6 @@ install:
9495 - if [ -f "doc/tutorial/configure.ac" ]; then
9596 (cd "doc/tutorial" && autoreconf -i);
9697 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
10998 - if [ -f "doc/cookbook/https/configure.ac" ]; then
11099 (cd "doc/cookbook/https" && autoreconf -i);
111100 fi
@@ -119,7 +108,7 @@ install:
119108 (cd "doc/cookbook/file-upload" && autoreconf -i);
120109 fi
121110 - 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
111+ - 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
123112 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
124113
125114# Here starts the actual work to be performed for the package under test;
@@ -134,22 +123,18 @@ script:
134123 - (cd "servant-foreign" && cabal sdist)
135124 - (cd "servant-server" && cabal sdist)
136125 - (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)
141126 - (cd "doc/cookbook/https" && cabal sdist)
142127 - (cd "doc/cookbook/structuring-apis" && cabal sdist)
143128 - (cd "doc/cookbook/using-custom-monad" && cabal sdist)
144129 - (cd "doc/cookbook/file-upload" && cabal sdist)
145130 - echo -en 'travis_fold:end:sdist\\r'
146131 - 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}/
132+ - 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}/
148133 - cd ${DISTDIR} || false
149134 - 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"
135+ - "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"
151136 - "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"
137+ - "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, http-media:base' >> cabal.project"
153138 - cat cabal.project
154139 - echo -en 'travis_fold:end:unpack\\r'
155140
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+24−2
@@ -5,11 +5,33 @@ 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
1433 foundation >=0.0.14,
1534 memory <0.14.12 || >0.14.12
35+
36+allow-newer:
37+ http-media:base
doc/tutorial/tutorial.cabal+1−1
@@ -34,7 +34,7 @@ library
3434 -- Packages `servant` depends on.
3535 -- We don't need to specify bounds here as this package is never released.
3636 build-depends:
37− base >= 4.7 && <4.11
37+ base >= 4.7 && <4.12
3838 , aeson
3939 , aeson-compat
4040 , 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+6−6
@@ -1,5 +1,5 @@
11name: servant-client-core
2−version: 0.12
2+version: 0.13
33synopsis: Core functionality and class for client function generation for servant APIs
44description:
55 This library provides backend-agnostic generation of client functions. For
@@ -45,7 +45,7 @@ library
4545 --
4646 -- note: mtl lower bound is so low because of GHC-7.8
4747 build-depends:
48− base >= 4.7 && < 4.11
48+ base >= 4.7 && < 4.12
4949 , bytestring >= 0.10.4.0 && < 0.11
5050 , containers >= 0.5.5.1 && < 0.6
5151 , mtl >= 2.1 && < 2.3
@@ -57,14 +57,14 @@ library
5757
5858 -- Servant dependencies
5959 build-depends:
60− servant == 0.12.*
60+ servant == 0.13.*
6161
6262 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6363 -- Here can be exceptions if we really need features from the newer versions.
6464 build-depends:
6565 base-compat >= 0.9.3 && < 0.10
6666 , base64-bytestring >= 1.0.0.1 && < 1.1
67− , exceptions >= 0.8.3 && < 0.9
67+ , exceptions >= 0.8.3 && < 0.11
6868 , generics-sop >= 0.3.1.0 && < 0.4
6969 , http-api-data >= 0.3.7.1 && < 0.4
7070 , http-media >= 0.7.1.1 && < 0.8
@@ -95,8 +95,8 @@ test-suite spec
9595 -- Additonal dependencies
9696 build-depends:
9797 deepseq >= 1.3.0.2 && <1.5
98− , hspec >= 2.4.4 && <2.5
98+ , hspec >= 2.4.4 && <2.6
9999 , QuickCheck >= 2.10.1 && < 2.12
100100
101101 build-tool-depends:
102− hspec-discover:hspec-discover >= 2.4.4 && <2.5
102+ 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+10−10
@@ -1,5 +1,5 @@
11name: servant-client
2−version: 0.12.0.1
2+version: 0.13
33synopsis: automatical derivation of querying functions for servant webservices
44description:
55 This library lets you derive automatically Haskell functions that
@@ -41,7 +41,7 @@ library
4141 --
4242 -- note: mtl lower bound is so low because of GHC-7.8
4343 build-depends:
44− base >= 4.7 && < 4.11
44+ base >= 4.7 && < 4.12
4545 , bytestring >= 0.10.4.0 && < 0.11
4646 , containers >= 0.5.5.1 && < 0.6
4747 , mtl >= 2.1 && < 2.3
@@ -54,24 +54,24 @@ library
5454
5555 -- Servant dependencies
5656 build-depends:
57− servant-client-core == 0.12.*
57+ servant-client-core == 0.13.*
5858
5959 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6060 -- Here can be exceptions if we really need features from the newer versions.
6161 build-depends:
62− aeson >= 1.2.3.0 && < 1.3
62+ aeson >= 1.2.3.0 && < 1.4
6363 , base-compat >= 0.9.3 && < 0.10
6464 , attoparsec >= 0.13.2.0 && < 0.14
6565 , http-client >= 0.5.7.1 && < 0.6
6666 , http-client-tls >= 0.3.5.1 && < 0.4
6767 , http-media >= 0.7.1.1 && < 0.8
6868 , http-types >= 0.12 && < 0.13
69− , exceptions >= 0.8.3 && < 0.9
69+ , exceptions >= 0.8.3 && < 0.11
7070 , monad-control >= 1.0.0.4 && < 1.1
7171 , semigroupoids >= 5.2.1 && < 5.3
7272 , stm >= 2.4.4.1 && < 2.5
7373 , transformers-base >= 0.4.4 && < 0.5
74− , transformers-compat >= 0.5.1 && < 0.6
74+ , transformers-compat >= 0.5.1 && < 0.7
7575
7676 hs-source-dirs: src
7777 default-language: Haskell2010
@@ -114,12 +114,12 @@ test-suite spec
114114 build-depends:
115115 deepseq >= 1.3.0.2 && < 1.5
116116 , generics-sop >= 0.3.1.0 && < 0.4
117− , hspec >= 2.4.4 && < 2.5
117+ , hspec >= 2.4.4 && < 2.6
118118 , HUnit >= 1.6 && < 1.7
119119 , network >= 2.6.3.2 && < 2.7
120120 , QuickCheck >= 2.10.1 && < 2.12
121− , servant == 0.12.*
122− , servant-server == 0.12.*
121+ , servant == 0.13.*
122+ , servant-server == 0.13.*
123123
124124 build-tool-depends:
125− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
125+ 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+6−6
@@ -1,5 +1,5 @@
11name: servant-docs
2−version: 0.11.1
2+version: 0.11.2
33synopsis: generate API docs for your servant webservice
44description:
55 Library for generating API docs from a servant API definition.
@@ -41,7 +41,7 @@ library
4141 --
4242 -- note: mtl lower bound is so low because of GHC-7.8
4343 build-depends:
44− base >= 4.7 && < 4.11
44+ base >= 4.7 && < 4.12
4545 , bytestring >= 0.10.4.0 && < 0.11
4646 , text >= 1.2.3.0 && < 1.3
4747
@@ -51,12 +51,12 @@ library
5151
5252 -- Servant dependencies
5353 build-depends:
54− servant == 0.12.*
54+ servant == 0.13.*
5555
5656 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5757 -- Here can be exceptions if we really need features from the newer versions.
5858 build-depends:
59− aeson >= 1.2.3.0 && < 1.3
59+ aeson >= 1.2.3.0 && < 1.4
6060 , aeson-pretty >= 0.8.5 && < 0.9
6161 , base-compat >= 0.9.3 && < 0.10
6262 , case-insensitive >= 1.2.0.10 && < 1.3
@@ -108,7 +108,7 @@ test-suite spec
108108
109109 -- Additonal dependencies
110110 build-depends:
111− hspec >= 2.4.4 && < 2.5
111+ hspec >= 2.4.4 && < 2.6
112112
113113 build-tool-depends:
114− hspec-discover:hspec-discover >=2.4.4 && <2.5
114+ 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+9−5
@@ -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
@@ -42,12 +42,16 @@ library
4242 --
4343 -- note: mtl lower bound is so low because of GHC-7.8
4444 build-depends:
45− base >= 4.7 && <4.11
45+ base >= 4.7 && <4.12
4646 , text >= 1.2.3.0 && < 1.3
4747
48+ if !impl(ghc >= 8.0)
49+ build-depends:
50+ semigroups >=0.18.3 && <0.19
51+
4852 -- Servant dependencies
4953 build-depends:
50− servant == 0.12.*
54+ servant == 0.13.*
5155
5256 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5357 -- Here can be exceptions if we really need features from the newer versions.
@@ -79,8 +83,8 @@ test-suite spec
7983
8084 -- Additonal dependencies
8185 build-depends:
82− hspec >= 2.4.4 && <2.5
86+ hspec >= 2.4.4 && <2.6
8387
8488 build-tool-depends:
85− hspec-discover:hspec-discover >=2.4.4 && <2.5
89+ hspec-discover:hspec-discover >=2.4.4 && <2.6
8690 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+10−10
@@ -1,5 +1,5 @@
11name: servant-server
2−version: 0.12
2+version: 0.13
33synopsis: A family of combinators for defining webservices APIs and serving them
44description:
55 A family of combinators for defining webservices APIs and serving them
@@ -60,7 +60,7 @@ library
6060 --
6161 -- note: mtl lower bound is so low because of GHC-7.8
6262 build-depends:
63− base >= 4.7 && < 4.11
63+ base >= 4.7 && < 4.12
6464 , bytestring >= 0.10.4.0 && < 0.11
6565 , containers >= 0.5.5.1 && < 0.6
6666 , mtl >= 2.1 && < 2.3
@@ -70,16 +70,16 @@ library
7070
7171 -- Servant dependencies
7272 build-depends:
73− servant == 0.12.*
73+ servant == 0.13.*
7474
7575 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
7676 -- Here can be exceptions if we really need features from the newer versions.
7777 build-depends:
78− aeson >= 1.2.3.0 && < 1.3
78+ aeson >= 1.2.3.0 && < 1.4
7979 , base-compat >= 0.9.3 && < 0.10
8080 , attoparsec >= 0.13.2.0 && < 0.14
8181 , base64-bytestring >= 1.0.0.1 && < 1.1
82− , exceptions >= 0.8.3 && < 0.9
82+ , exceptions >= 0.8.3 && < 0.11
8383 , http-api-data >= 0.3.7.1 && < 0.4
8484 , http-media >= 0.7.1.1 && < 0.8
8585 , http-types >= 0.12 && < 0.13
@@ -90,10 +90,10 @@ library
9090 , split >= 0.2.3.2 && < 0.3
9191 , string-conversions >= 0.4.0.1 && < 0.5
9292 , system-filepath >= 0.4 && < 0.5
93− , resourcet >= 1.1.10 && < 1.2
93+ , resourcet >= 1.1.9 && < 1.3
9494 , tagged >= 0.8.5 && < 0.9
9595 , transformers-base >= 0.4.4 && < 0.5
96− , transformers-compat >= 0.5.1 && < 0.6
96+ , transformers-compat >= 0.5.1 && < 0.7
9797 , wai >= 3.2.1.1 && < 3.3
9898 , wai-app-static >= 3.1.6.1 && < 3.2
9999 , warp >= 3.2.13 && < 3.3
@@ -164,7 +164,7 @@ test-suite spec
164164 -- Additonal dependencies
165165 build-depends:
166166 directory >= 1.2.1.0 && < 1.4
167− , hspec >= 2.4.4 && < 2.5
167+ , hspec >= 2.4.4 && < 2.6
168168 , hspec-wai >= 0.9 && < 0.10
169169 , should-not-typecheck >= 2.1.0 && < 2.2
170170 , parsec >= 3.1.11 && < 3.2
@@ -173,13 +173,13 @@ test-suite spec
173173 , temporary >= 1.2.0.3 && < 1.3
174174
175175 build-tool-depends:
176− hspec-discover:hspec-discover >=2.4.4 && <2.5
176+ hspec-discover:hspec-discover >=2.4.4 && <2.6
177177
178178test-suite doctests
179179 build-depends:
180180 base
181181 , servant-server
182− , doctest >= 0.13.0 && <0.14
182+ , doctest >= 0.13.0 && <0.16
183183 type: exitcode-stdio-1.0
184184 main-is: test/doctests.hs
185185 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+7−7
@@ -1,5 +1,5 @@
11name: servant
2−version: 0.12
2+version: 0.13
33synopsis: A family of combinators for defining webservices APIs
44description:
55 A family of combinators for defining webservices APIs and serving them
@@ -69,7 +69,7 @@ library
6969 --
7070 -- note: mtl lower bound is so low because of GHC-7.8
7171 build-depends:
72− base >= 4.7 && < 4.11
72+ base >= 4.7 && < 4.12
7373 , bytestring >= 0.10.4.0 && < 0.11
7474 , mtl >= 2.1 && < 2.3
7575 , text >= 1.2.3.0 && < 1.3
@@ -82,7 +82,7 @@ library
8282 -- Here can be exceptions if we really need features from the newer versions.
8383 build-depends:
8484 base-compat >= 0.9.3 && < 0.10
85− , aeson >= 1.2.3.0 && < 1.3
85+ , aeson >= 1.2.3.0 && < 1.4
8686 , attoparsec >= 0.13.2.0 && < 0.14
8787 , case-insensitive >= 1.2.0.10 && < 1.3
8888 , http-api-data >= 0.3.7.1 && < 0.4
@@ -153,22 +153,22 @@ test-suite spec
153153 -- Additonal dependencies
154154 build-depends:
155155 aeson-compat >= 0.3.3 && < 0.4
156− , hspec >= 2.4.4 && < 2.5
156+ , hspec >= 2.4.4 && < 2.6
157157 , QuickCheck >= 2.10.1 && < 2.12
158158 , quickcheck-instances >= 0.3.16 && < 0.4
159159
160160 build-tool-depends:
161− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
161+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
162162
163163test-suite doctests
164164 build-depends:
165165 base
166166 , servant
167− , doctest >= 0.13.0 && <0.14
167+ , doctest >= 0.13.0 && <0.16
168168
169169 -- We test Links failure with doctest, so we need extra dependencies
170170 build-depends:
171− hspec >= 2.4.4 && < 2.5
171+ hspec >= 2.4.4 && < 2.6
172172
173173 type: exitcode-stdio-1.0
174174 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