git.iko.soy/typeable/servant
on 0f0c8f7 help sign in
32 files changed+379−159
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+14 servant-client-core/servant-client-core.cabal+13−12 servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+4−4 servant-client-ghcjs/servant-client-ghcjs.cabal+4−4 servant-client/CHANGELOG.md+16 servant-client/servant-client.cabal+21−16 servant-client/test/Servant/ClientSpec.hs+2−1 servant-docs/CHANGELOG.md+7 servant-docs/servant-docs.cabal+14−12 servant-docs/src/Servant/Docs/Internal.hs+1−1 servant-foreign/CHANGELOG.md+8−1 servant-foreign/servant-foreign.cabal+16−10 servant-foreign/src/Servant/Foreign/Internal.hs+5−4 servant-server/CHANGELOG.md+13 servant-server/servant-server.cabal+22−17 servant-server/src/Servant/Server/Internal.hs+9−8 servant-server/src/Servant/Server/Internal/RoutingApplication.hs+15−7 servant/CHANGELOG.md+82 servant/servant.cabal+15−14 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+4−4
.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+14
@@ -1,6 +1,20 @@
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.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+
4180.12
519----
620
servant-client-core/servant-client-core.cabal+13−12
@@ -1,5 +1,5 @@
11name: servant-client-core
2−version: 0.12
2+version: 0.13.0.1
33synopsis: Core functionality and class for client function generation for servant APIs
44description:
55 This library provides backend-agnostic generation of client functions. For
@@ -19,10 +19,11 @@ extra-source-files:
1919 CHANGELOG.md
2020 README.md
2121tested-with:
22− GHC==7.8.4
23− GHC==7.10.3
24− GHC==8.0.2
25− 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
2627
2728source-repository head
2829 type: git
@@ -45,7 +46,7 @@ library
4546 --
4647 -- note: mtl lower bound is so low because of GHC-7.8
4748 build-depends:
48− base >= 4.7 && < 4.11
49+ base >= 4.7 && < 4.12
4950 , bytestring >= 0.10.4.0 && < 0.11
5051 , containers >= 0.5.5.1 && < 0.6
5152 , mtl >= 2.1 && < 2.3
@@ -57,17 +58,17 @@ library
5758
5859 -- Servant dependencies
5960 build-depends:
60− servant == 0.12.*
61+ servant == 0.13.*
6162
6263 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6364 -- Here can be exceptions if we really need features from the newer versions.
6465 build-depends:
65− base-compat >= 0.9.3 && < 0.10
66+ base-compat >= 0.9.3 && < 0.11
6667 , base64-bytestring >= 1.0.0.1 && < 1.1
67− , exceptions >= 0.8.3 && < 0.9
68+ , exceptions >= 0.8.3 && < 0.11
6869 , generics-sop >= 0.3.1.0 && < 0.4
6970 , 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
7172 , http-types >= 0.12 && < 0.13
7273 , network-uri >= 2.6.1.0 && < 2.7
7374 , safe >= 0.3.15 && < 0.4
@@ -95,8 +96,8 @@ test-suite spec
9596 -- Additonal dependencies
9697 build-depends:
9798 deepseq >= 1.3.0.2 && <1.5
98− , hspec >= 2.4.4 && <2.5
99+ , hspec >= 2.4.4 && <2.6
99100 , QuickCheck >= 2.10.1 && < 2.12
100101
101102 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)
2121import Data.Foldable (toList)
2222import qualified Data.ByteString.Lazy as BL
2323import Data.List (foldl')
24−import Data.Monoid ((<>))
2524import Data.Proxy (Proxy (Proxy))
25+import Data.Semigroup ((<>))
2626import Data.Sequence (fromList)
2727import Data.String (fromString)
2828import Data.Text (Text, pack)
@@ -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+16
@@ -1,6 +1,22 @@
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.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+- *servant-client* Support `http-client`’s `CookieJar`
17+ ([#897](https://github.com/haskell-servant/servant/pull/897)
18+ [#883](https://github.com/haskell-servant/servant/pull/883))
19+
4200.12.0.1
521--------
622
servant-client/servant-client.cabal+21−16
@@ -1,5 +1,5 @@
11name: servant-client
2−version: 0.12.0.1
2+version: 0.13.0.1
33synopsis: automatical derivation of querying functions for servant webservices
44description:
55 This library lets you derive automatically Haskell functions that
@@ -17,10 +17,11 @@ category: Servant, Web
1717build-type: Simple
1818cabal-version: >=1.10
1919tested-with:
20− GHC==7.8.4
21− GHC==7.10.3
22− GHC==8.0.2
23− 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
2425homepage: http://haskell-servant.readthedocs.org/
2526Bug-reports: http://github.com/haskell-servant/servant/issues
2627extra-source-files:
@@ -41,7 +42,7 @@ library
4142 --
4243 -- note: mtl lower bound is so low because of GHC-7.8
4344 build-depends:
44− base >= 4.7 && < 4.11
45+ base >= 4.7 && < 4.12
4546 , bytestring >= 0.10.4.0 && < 0.11
4647 , containers >= 0.5.5.1 && < 0.6
4748 , mtl >= 2.1 && < 2.3
@@ -54,24 +55,24 @@ library
5455
5556 -- Servant dependencies
5657 build-depends:
57− servant-client-core == 0.12.*
58+ servant-client-core == 0.13.*
5859
5960 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6061 -- Here can be exceptions if we really need features from the newer versions.
6162 build-depends:
62− aeson >= 1.2.3.0 && < 1.3
63− , base-compat >= 0.9.3 && < 0.10
63+ aeson >= 1.2.3.0 && < 1.4
64+ , base-compat >= 0.9.3 && < 0.11
6465 , attoparsec >= 0.13.2.0 && < 0.14
6566 , http-client >= 0.5.7.1 && < 0.6
6667 , http-client-tls >= 0.3.5.1 && < 0.4
67− , http-media >= 0.7.1.1 && < 0.8
68+ , http-media >= 0.7.0 && < 0.8
6869 , http-types >= 0.12 && < 0.13
69− , exceptions >= 0.8.3 && < 0.9
70+ , exceptions >= 0.8.3 && < 0.11
7071 , monad-control >= 1.0.0.4 && < 1.1
7172 , semigroupoids >= 5.2.1 && < 5.3
7273 , stm >= 2.4.4.1 && < 2.5
7374 , transformers-base >= 0.4.4 && < 0.5
74− , transformers-compat >= 0.5.1 && < 0.6
75+ , transformers-compat >= 0.5.1 && < 0.7
7576
7677 hs-source-dirs: src
7778 default-language: Haskell2010
@@ -110,16 +111,20 @@ test-suite spec
110111 , wai
111112 , warp
112113
114+ if !impl(ghc >= 8.0)
115+ build-depends:
116+ semigroups
117+
113118 -- Additonal dependencies
114119 build-depends:
115120 deepseq >= 1.3.0.2 && < 1.5
116121 , generics-sop >= 0.3.1.0 && < 0.4
117− , hspec >= 2.4.4 && < 2.5
122+ , hspec >= 2.4.4 && < 2.6
118123 , HUnit >= 1.6 && < 1.7
119124 , network >= 2.6.3.2 && < 2.7
120125 , QuickCheck >= 2.10.1 && < 2.12
121− , servant == 0.12.*
122− , servant-server == 0.12.*
126+ , servant == 0.13.*
127+ , servant-server == 0.13.*
123128
124129 build-tool-depends:
125− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
130+ 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)
3737import Data.Aeson
3838import Data.Char (chr, isPrint)
3939import Data.Foldable (forM_)
40−import Data.Monoid hiding (getLast)
40+import Data.Semigroup ((<>))
41+import Data.Monoid ()
4142import Data.Proxy
4243import qualified Generics.SOP as SOP
4344import GHC.Generics (Generic)
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+14−12
@@ -1,5 +1,6 @@
11name: servant-docs
2−version: 0.11.1
2+version: 0.11.2
3+x-revision: 2
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
61− , base-compat >= 0.9.3 && < 0.10
63+ , base-compat >= 0.9.3 && < 0.11
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+16−10
@@ -1,5 +1,6 @@
11name: servant-foreign
2−version: 0.11
2+version: 0.11.1
3+x-revision: 1
34synopsis: Helpers for generating clients for servant APIs in any programming language
45description:
56 Helper types and functions for generating client functions for servant APIs in any programming language
@@ -23,10 +24,11 @@ extra-source-files:
2324 README.md
2425bug-reports: http://github.com/haskell-servant/servant/issues
2526tested-with:
26− GHC==7.8.4
27− GHC==7.10.3
28− GHC==8.0.2
29− GHC==8.2.2
27+ GHC==7.8.4,
28+ GHC==7.10.3,
29+ GHC==8.0.2,
30+ GHC==8.2.2,
31+ GHC==8.4.1
3032
3133source-repository head
3234 type: git
@@ -42,17 +44,21 @@ library
4244 --
4345 -- note: mtl lower bound is so low because of GHC-7.8
4446 build-depends:
45− base >= 4.7 && <4.11
47+ base >= 4.7 && <4.12
4648 , text >= 1.2.3.0 && < 1.3
4749
50+ if !impl(ghc >= 8.0)
51+ build-depends:
52+ semigroups >=0.18.3 && <0.19
53+
4854 -- Servant dependencies
4955 build-depends:
50− servant == 0.12.*
56+ servant == 0.13.*
5157
5258 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5359 -- Here can be exceptions if we really need features from the newer versions.
5460 build-depends:
55− base-compat >= 0.9.3 && <0.10
61+ base-compat >= 0.9.3 && <0.11
5662 , lens >= 4.15.4 && <4.17
5763 , http-types >= 0.12 && < 0.13
5864
@@ -79,8 +85,8 @@ test-suite spec
7985
8086 -- Additonal dependencies
8187 build-depends:
82− hspec >= 2.4.4 && <2.5
88+ hspec >= 2.4.4 && <2.6
8389
8490 build-tool-depends:
85− hspec-discover:hspec-discover >=2.4.4 && <2.5
91+ hspec-discover:hspec-discover >=2.4.4 && <2.6
8692 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+13
@@ -1,6 +1,19 @@
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.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+
4170.12
518----
619
servant-server/servant-server.cabal+22−17
@@ -1,5 +1,5 @@
11name: servant-server
2−version: 0.12
2+version: 0.13.0.1
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
@@ -22,10 +22,11 @@ category: Servant, Web
2222build-type: Custom
2323cabal-version: >=1.10
2424tested-with:
25− GHC==7.8.4
26− GHC==7.10.3
27− GHC==8.0.2
28− GHC==8.2.2
25+ GHC==7.8.4,
26+ GHC==7.10.3,
27+ GHC==8.0.2,
28+ GHC==8.2.2,
29+ GHC==8.4.1
2930extra-source-files:
3031 include/*.h
3132 CHANGELOG.md
@@ -60,7 +61,7 @@ library
6061 --
6162 -- note: mtl lower bound is so low because of GHC-7.8
6263 build-depends:
63− base >= 4.7 && < 4.11
64+ base >= 4.7 && < 4.12
6465 , bytestring >= 0.10.4.0 && < 0.11
6566 , containers >= 0.5.5.1 && < 0.6
6667 , mtl >= 2.1 && < 2.3
@@ -68,20 +69,24 @@ library
6869 , transformers >= 0.3.0.0 && < 0.6
6970 , filepath >= 1.3.0.2 && < 1.5
7071
72+ if !impl(ghc >= 8.0)
73+ build-depends:
74+ semigroups >= 0.18.3 && < 0.19
75+
7176 -- Servant dependencies
7277 build-depends:
73− servant == 0.12.*
78+ servant == 0.13.*
7479
7580 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
7681 -- Here can be exceptions if we really need features from the newer versions.
7782 build-depends:
78− aeson >= 1.2.3.0 && < 1.3
79− , base-compat >= 0.9.3 && < 0.10
83+ aeson >= 1.2.3.0 && < 1.4
84+ , base-compat >= 0.9.3 && < 0.11
8085 , attoparsec >= 0.13.2.0 && < 0.14
8186 , base64-bytestring >= 1.0.0.1 && < 1.1
82− , exceptions >= 0.8.3 && < 0.9
87+ , exceptions >= 0.8.3 && < 0.11
8388 , 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
8590 , http-types >= 0.12 && < 0.13
8691 , network-uri >= 2.6.1.0 && < 2.7
8792 , monad-control >= 1.0.0.4 && < 1.1
@@ -90,10 +95,10 @@ library
9095 , split >= 0.2.3.2 && < 0.3
9196 , string-conversions >= 0.4.0.1 && < 0.5
9297 , system-filepath >= 0.4 && < 0.5
93− , resourcet >= 1.1.10 && < 1.2
98+ , resourcet >= 1.1.9 && < 1.3
9499 , tagged >= 0.8.5 && < 0.9
95100 , transformers-base >= 0.4.4 && < 0.5
96− , transformers-compat >= 0.5.1 && < 0.6
101+ , transformers-compat >= 0.5.1 && < 0.7
97102 , wai >= 3.2.1.1 && < 3.3
98103 , wai-app-static >= 3.1.6.1 && < 3.2
99104 , warp >= 3.2.13 && < 3.3
@@ -164,22 +169,22 @@ test-suite spec
164169 -- Additonal dependencies
165170 build-depends:
166171 directory >= 1.2.1.0 && < 1.4
167− , hspec >= 2.4.4 && < 2.5
172+ , hspec >= 2.4.4 && < 2.6
168173 , hspec-wai >= 0.9 && < 0.10
169174 , should-not-typecheck >= 2.1.0 && < 2.2
170175 , parsec >= 3.1.11 && < 3.2
171176 , QuickCheck >= 2.10.1 && < 2.12
172177 , wai-extra >= 3.0.21.0 && < 3.1
173− , temporary >= 1.2.0.3 && < 1.3
178+ , temporary >= 1.2.0.3 && < 1.4
174179
175180 build-tool-depends:
176− hspec-discover:hspec-discover >=2.4.4 && <2.5
181+ hspec-discover:hspec-discover >=2.4.4 && <2.6
177182
178183test-suite doctests
179184 build-depends:
180185 base
181186 , servant-server
182− , doctest >= 0.13.0 && <0.14
187+ , doctest >= 0.13.0 && <0.16
183188 type: exitcode-stdio-1.0
184189 main-is: test/doctests.hs
185190 buildable: True
servant-server/src/Servant/Server/Internal.hs+9−8
@@ -44,8 +44,9 @@ import qualified Data.ByteString.Lazy as BL
4444import Data.Maybe (fromMaybe, mapMaybe,
4545 isNothing, maybeToList)
4646import Data.Either (partitionEithers)
47+import Data.Semigroup ((<>))
4748import Data.String (IsString (..))
48−import Data.String.Conversions (cs, (<>))
49+import Data.String.Conversions (cs)
4950import Data.Tagged (Tagged(..), retag, untag)
5051import qualified Data.Text as T
5152import Data.Typeable
@@ -67,7 +68,7 @@ import Web.HttpApiData (FromHttpApiData, parseHeader,
6768 parseQueryParam,
6869 parseUrlPieceMaybe,
6970 parseUrlPieces)
70−import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture,
71+import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture',
7172 CaptureAll, Verb, EmptyAPI,
7273 ReflectMethod(reflectMethod),
7374 IsSecure(..), Header', QueryFlag,
@@ -164,9 +165,9 @@ instance (HasServer a context, HasServer b context) => HasServer (a :<|> b) cont
164165-- > where getBook :: Text -> Handler Book
165166-- > getBook isbn = ...
166167instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
167− => HasServer (Capture capture a :> api) context where
168+ => HasServer (Capture' mods capture a :> api) context where
168169
169− type ServerT (Capture capture a :> api) m =
170+ type ServerT (Capture' mods capture a :> api) m =
170171 a -> ServerT api m
171172
172173 hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
@@ -749,14 +750,14 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
749750-- ...
750751-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
751752-- ...Maybe you haven't applied enough arguments to
752−-- ...Capture "foo"
753+-- ...Capture' '[] "foo"
753754-- ...
754755--
755756-- >>> undefined :: Server (Capture "foo" :> Get '[JSON] Int)
756757-- ...
757758-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
758759-- ...Maybe you haven't applied enough arguments to
759−-- ...Capture "foo"
760+-- ...Capture' '[] "foo"
760761-- ...
761762--
762763instance TypeError (HasServerArrowKindError arr) => HasServer ((arr :: k -> l) :> api) context
@@ -778,7 +779,7 @@ type HasServerArrowKindError arr =
778779-- ...
779780-- ...No instance HasServer (a -> b).
780781-- ...Maybe you have used '->' instead of ':>' between
781−-- ...Capture "foo" Int
782+-- ...Capture' '[] "foo" Int
782783-- ...and
783784-- ...Verb 'GET 200 '[JSON] Int
784785-- ...
@@ -787,7 +788,7 @@ type HasServerArrowKindError arr =
787788-- ...
788789-- ...No instance HasServer (a -> b).
789790-- ...Maybe you have used '->' instead of ':>' between
790−-- ...Capture "foo" Int
791+-- ...Capture' '[] "foo" Int
791792-- ...and
792793-- ...Verb 'GET 200 '[JSON] Int
793794-- ...
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+82
@@ -1,5 +1,87 @@
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.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+
3850.12.1
486------
587
servant/servant.cabal+15−14
@@ -1,5 +1,5 @@
11name: servant
2−version: 0.12
2+version: 0.13.0.1
33synopsis: A family of combinators for defining webservices APIs
44description:
55 A family of combinators for defining webservices APIs and serving them
@@ -18,10 +18,11 @@ category: Servant, Web
1818build-type: Custom
1919cabal-version: >=1.10
2020tested-with:
21− GHC==7.8.4
22− GHC==7.10.3
23− GHC==8.0.2
24− 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
2526extra-source-files:
2627 include/*.h
2728 CHANGELOG.md
@@ -69,7 +70,7 @@ library
6970 --
7071 -- note: mtl lower bound is so low because of GHC-7.8
7172 build-depends:
72− base >= 4.7 && < 4.11
73+ base >= 4.7 && < 4.12
7374 , bytestring >= 0.10.4.0 && < 0.11
7475 , mtl >= 2.1 && < 2.3
7576 , text >= 1.2.3.0 && < 1.3
@@ -80,13 +81,13 @@ library
8081
8182 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
8283 -- Here can be exceptions if we really need features from the newer versions.
83− build-depends:
84− base-compat >= 0.9.3 && < 0.10
85− , aeson >= 1.2.3.0 && < 1.3
84+ build-depends:
85+ base-compat >= 0.9.3 && < 0.11
86+ , aeson >= 1.2.3.0 && < 1.4
8687 , attoparsec >= 0.13.2.0 && < 0.14
8788 , case-insensitive >= 1.2.0.10 && < 1.3
8889 , 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
9091 , http-types >= 0.12 && < 0.13
9192 , natural-transformation >= 0.4 && < 0.5
9293 , mmorph >= 1.1.0 && < 1.2
@@ -153,22 +154,22 @@ test-suite spec
153154 -- Additonal dependencies
154155 build-depends:
155156 aeson-compat >= 0.3.3 && < 0.4
156− , hspec >= 2.4.4 && < 2.5
157+ , hspec >= 2.4.4 && < 2.6
157158 , QuickCheck >= 2.10.1 && < 2.12
158159 , quickcheck-instances >= 0.3.16 && < 0.4
159160
160161 build-tool-depends:
161− hspec-discover:hspec-discover >= 2.4.4 && < 2.5
162+ hspec-discover:hspec-discover >= 2.4.4 && < 2.6
162163
163164test-suite doctests
164165 build-depends:
165166 base
166167 , servant
167− , doctest >= 0.13.0 && <0.14
168+ , doctest >= 0.13.0 && <0.16
168169
169170 -- We test Links failure with doctest, so we need extra dependencies
170171 build-depends:
171− hspec >= 2.4.4 && < 2.5
172+ hspec >= 2.4.4 && < 2.6
172173
173174 type: exitcode-stdio-1.0
174175 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+4−4
@@ -101,7 +101,7 @@ module Servant.Utils.Links (
101101) where
102102
103103import Data.List
104−import Data.Monoid.Compat ( (<>) )
104+import Data.Semigroup ((<>))
105105import Data.Proxy ( Proxy(..) )
106106import Data.Singletons.Bool ( SBool (..), SBoolI (..) )
107107import qualified Data.Text as Text
@@ -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