on 5fe3b4e help sign in
20 files changed+283−146
since splitsnapshots
unifiedsplit
.travis.yml+30−11 cabal.make-travis-yml+1−1 cabal.project+2−8 doc/index.rst+11−9 doc/introduction.rst → doc/principles.rst+2−2 doc/tutorial/Javascript.lhs+1−2 doc/tutorial/index.rst+21−2 servant-client-core/CHANGELOG.md+42−2 servant-client-core/servant-client-core.cabal+12−13 servant-client-ghcjs/servant-client-ghcjs.cabal+1−1 servant-client/CHANGELOG.md+37−2 servant-client/servant-client.cabal+17−23 servant-client/test/Servant/StreamSpec.hs+2 servant-docs/servant-docs.cabal+1−1 servant-foreign/servant-foreign.cabal+1 servant-server/CHANGELOG.md+46 servant-server/servant-server.cabal+23−31 servant/CHANGELOG.md+14−5 servant/servant.cabal+18−19 stack.yaml+1−14
.travis.yml+30−11
@@ -13,7 +13,7 @@ git:
1313branches:
1414 only:
1515 - master
16− - release-0.12
16+ - release-0.14
1717
1818cache:
1919 directories:
@@ -65,17 +65,21 @@ install:
6565 - BENCH=${BENCH---enable-benchmarks}
6666 - TEST=${TEST---enable-tests}
6767 - HADDOCK=${HADDOCK-true}
68− - INSTALLED=${INSTALLED-true}
68+ - UNCONSTRAINED=${UNCONSTRAINED-true}
69+ - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
6970 - GHCHEAD=${GHCHEAD-false}
7071 - travis_retry cabal update -v
7172 - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
7273 - rm -fv cabal.project cabal.project.local
7374 - "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
7475 - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
75− - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/basic-auth\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/https\" \"doc/cookbook/pagination\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\"\\n' > cabal.project"
76+ - "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/basic-auth\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/file-upload\" \"doc/cookbook/https\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/pagination\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\"\\n' > cabal.project"
7677 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
77− - "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, http-media:base' >> cabal.project"
78− - cat cabal.project
78+ - "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
79+ - touch cabal.project.local
80+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
81+ - cat cabal.project || true
82+ - cat cabal.project.local || true
7983 - if [ -f "servant/configure.ac" ]; then
8084 (cd "servant" && autoreconf -i);
8185 fi
@@ -106,9 +110,15 @@ install:
106110 - if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then
107111 (cd "doc/cookbook/db-sqlite-simple" && autoreconf -i);
108112 fi
113+ - if [ -f "doc/cookbook/file-upload/configure.ac" ]; then
114+ (cd "doc/cookbook/file-upload" && autoreconf -i);
115+ fi
109116 - if [ -f "doc/cookbook/https/configure.ac" ]; then
110117 (cd "doc/cookbook/https" && autoreconf -i);
111118 fi
119+ - if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then
120+ (cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i);
121+ fi
112122 - if [ -f "doc/cookbook/pagination/configure.ac" ]; then
113123 (cd "doc/cookbook/pagination" && autoreconf -i);
114124 fi
@@ -119,7 +129,7 @@ install:
119129 (cd "doc/cookbook/using-custom-monad" && autoreconf -i);
120130 fi
121131 - rm -f cabal.project.freeze
122− - 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/basic-auth"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/https"/dist "doc/cookbook/pagination"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist
132+ - 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/basic-auth"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/https"/dist "doc/cookbook/jwt-and-basic-auth"/dist "doc/cookbook/pagination"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist
123133 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
124134
125135# Here starts the actual work to be performed for the package under test;
@@ -137,22 +147,26 @@ script:
137147 - (cd "doc/cookbook/basic-auth" && cabal sdist)
138148 - (cd "doc/cookbook/db-postgres-pool" && cabal sdist)
139149 - (cd "doc/cookbook/db-sqlite-simple" && cabal sdist)
150+ - (cd "doc/cookbook/file-upload" && cabal sdist)
140151 - (cd "doc/cookbook/https" && cabal sdist)
152+ - (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist)
141153 - (cd "doc/cookbook/pagination" && cabal sdist)
142154 - (cd "doc/cookbook/structuring-apis" && cabal sdist)
143155 - (cd "doc/cookbook/using-custom-monad" && cabal sdist)
144156 - echo -en 'travis_fold:end:sdist\\r'
145157 - echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
146− - 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/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz ${DISTDIR}/
158+ - 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/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/jwt-and-basic-auth"/dist/cookbook-jwt-and-basic-auth-*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz ${DISTDIR}/
147159 - cd ${DISTDIR} || false
148160 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
149− - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-https-*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal\\n' > cabal.project"
161+ - "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook-https-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal\\n' > cabal.project"
150162 - "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
151− - "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, http-media:base' >> cabal.project"
152− - cat cabal.project
163+ - "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
164+ - touch cabal.project.local
165+ - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
166+ - cat cabal.project || true
167+ - cat cabal.project.local || true
153168 - echo -en 'travis_fold:end:unpack\\r'
154169
155−
156170 - echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r'
157171 # build & run tests, build benchmarks
158172 - cabal new-build -w ${HC} ${TEST} ${BENCH} all
@@ -165,5 +179,10 @@ script:
165179 - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
166180
167181 - echo -en 'travis_fold:end:haddock\\r'
182+ - echo Building without installed constraints for packages in global-db... && echo -en 'travis_fold:start:build-installed\\r'
183+ # Build without installed constraints for packages in global-db
184+ - if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
185+
186+ - echo -en 'travis_fold:end:build-installed\\r'
168187# REGENDATA ["--config=cabal.make-travis-yml","--output=.travis.yml","cabal.project"]
169188# EOF
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.14
33
44-- We have inplace packages (servant-js) so we skip installing dependencies in a separate step
55install-dependencies-step: False
cabal.project+2−8
@@ -11,11 +11,9 @@ packages: servant/
1111 doc/cookbook/basic-auth
1212 doc/cookbook/db-postgres-pool
1313 doc/cookbook/db-sqlite-simple
14− -- MkLink changed
15− -- doc/cookbook/file-upload
14+ doc/cookbook/file-upload
1615 doc/cookbook/https
17− -- servant-auth-* doesn't support GHC-8.4
18− -- doc/cookbook/jwt-and-basic-auth
16+ doc/cookbook/jwt-and-basic-auth
1917 doc/cookbook/pagination
2018 doc/cookbook/structuring-apis
2119 doc/cookbook/using-custom-monad
@@ -30,9 +28,5 @@ constraints:
3028 memory <0.14.12 || >0.14.12
3129
3230allow-newer:
33− http-media:base
34−
35−allow-newer:
36− servant-js:servant,
3731 servant-pagination:servant,
3832 servant-pagination:servant-server
doc/index.rst+11−9
@@ -3,22 +3,24 @@ servant – A Type-Level Web DSL
33
44.. image:: https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png
55
6−**servant** is a set of packages for declaring web APIs at the type-level and
7−then using those API specifications to:
6+**servant** is a set of Haskell libraries for writing *type-safe* web
7+applications but also *deriving* clients (in Haskell and other languages) or
8+generating documentation for them, and more.
89
9−- write servers (this part of **servant** can be considered a web framework),
10−- obtain client functions (in haskell),
11−- generate client functions for other programming languages,
12−- generate documentation for your web applications
13−- and more...
10+This is achieved by taking as input a description of the web API
11+as a Haskell type. Servant is then able to check that your server-side request
12+handlers indeed implement your web API faithfully, or to automatically derive
13+Haskell functions that can hit a web application that implements this API,
14+generate a Swagger description or code for client functions in some other
15+languages directly.
1416
15−All in a type-safe manner.
17+If you would like to learn more, click the tutorial link below.
1618
1719.. toctree::
1820 :maxdepth: 2
1921
20− introduction.rst
2122 tutorial/index.rst
2223 cookbook/index.rst
2324 examples.md
2425 links.rst
26+ principles.rst
doc/introduction.rst → doc/principles.rstrenamed+2−2
@@ -1,5 +1,5 @@
1−Introduction
2−------------
1+Principles
2+----------
33
44**servant** has the following guiding principles:
55
doc/tutorial/Javascript.lhs+1−2
@@ -477,7 +477,7 @@ data AngularOptions = AngularOptions
477477 }
478478```
479479
480−# Custom function name builder
480+## Custom function name builder
481481
482482Servant comes with three name builders included:
483483
@@ -518,4 +518,3 @@ var get_books = function(q, onSuccess, onError)
518518}
519519
520520```
521−
doc/tutorial/index.rst+21−2
@@ -3,9 +3,28 @@ Tutorial
33
44This is an introductory tutorial to **servant**. Whilst browsing is fine, it makes more sense if you read the sections in order, or at least read the first section before anything else.
55
6−(Any comments, issues or feedback about the tutorial can be submitted
7−to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.)
6+Any comments, issues or feedback about the tutorial can be submitted
7+to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
88
9+In fact, the whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
10+project and can be built and played with locally as follows:
11+
12+.. code-block:: bash
13+
14+ $ git clone https://github.com/haskell-servant/servant.git
15+ $ cd servant
16+ # build
17+ $ cabal new-build tutorial
18+ # load in ghci to play with it
19+ $ cabal new-repl tutorial
20+
21+The code can be found in the `*.lhs` files under `doc/tutorial/` in the
22+repository. Feel free to edit it while you're reading this documentation and
23+see the effect of your changes.
24+
25+`Nix <https://nixos.org/nix/>`_ users should feel free to take a look at
26+the `nix/shell.nix` file in the repository and use it to provision a suitable
27+environment to build and run the examples.
928
1029.. toctree::
1130 :maxdepth: 1
servant-client-core/CHANGELOG.md+42−2
@@ -4,10 +4,50 @@
440.14
55----
66
7−- Add a `hoistClientMonad` method to the `HasClient` typeclass, for
8− changing the monad in which client functions run.
7+- `Stream` takes a status code argument
8+
9+ ```diff
10+ -Stream method framing ctype a
11+ +Stream method status framing ctype a
12+ ```
13+
14+ ([#966](https://github.com/haskell-servant/servant/pull/966)
15+ [#972](https://github.com/haskell-servant/servant/pull/972))
16+
17+- `ToStreamGenerator` definition changed, so it's possible to write an instance
18+ for conduits.
19+
20+ ```diff
21+ -class ToStreamGenerator f a where
22+ - toStreamGenerator :: f a -> StreamGenerator a
23+ +class ToStreamGenerator a b | a -> b where
24+ + toStreamGenerator :: a -> StreamGenerator b
25+ ```
26+
27+ ([#959](https://github.com/haskell-servant/servant/pull/959))
28+
29+- Added `NoFraming` streaming strategy
30+ ([#959](https://github.com/haskell-servant/servant/pull/959))
31+
32+- *servant-client-core* Free `Client` implementation.
33+ Useful for testing `HasClient` instances.
34+ ([#920](https://github.com/haskell-servant/servant/pull/920))
35+
36+- *servant-client-core* Add `hoistClient` to `HasClient`.
37+ Just like `hoistServer` allows us to change the monad in which request handlers
38+ of a web application live in, we also have `hoistClient` for changing the monad
39+ in which *client functions* live.
40+ Read [tutorial section for more information](https://haskell-servant.readthedocs.io/en/release-0.14/tutorial/Client.html#changing-the-monad-the-client-functions-live-in).
941 ([#936](https://github.com/haskell-servant/servant/pull/936))
1042
43+ iF you have own combinators, you'll need to define a new method of
44+ `HasClient` class, for example:
45+
46+ ```haskell
47+ type Client m (MyCombinator :> api) = MyValue :> Client m api
48+ hoistClientMonad pm _ nt cl = hoistClientMonad pm (Proxy :: Proxy api) nt . cl
49+ ```
50+
11510.13.0.1
1252--------
1353
servant-client-core/servant-client-core.cabal+12−13
@@ -51,12 +51,11 @@ library
5151 base >= 4.7 && < 4.12
5252 , bytestring >= 0.10.4.0 && < 0.11
5353 , containers >= 0.5.5.1 && < 0.6
54− , mtl >= 2.1 && < 2.3
5554 , text >= 1.2.3.0 && < 1.3
5655
5756 if !impl(ghc >= 8.0)
5857 build-depends:
59− semigroups >=0.18.3 && <0.19
58+ semigroups >=0.18.4 && <0.19
6059
6160 -- Servant dependencies
6261 build-depends:
@@ -65,16 +64,16 @@ library
6564 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6665 -- Here can be exceptions if we really need features from the newer versions.
6766 build-depends:
68− base-compat >= 0.9.3 && < 0.11
67+ base-compat >= 0.10.1 && < 0.11
6968 , base64-bytestring >= 1.0.0.1 && < 1.1
70− , exceptions >= 0.8.3 && < 0.11
71− , free >= 5.0.1 && < 5.1
72− , generics-sop >= 0.3.1.0 && < 0.4
73− , http-api-data >= 0.3.7.1 && < 0.4
74− , http-media >= 0.7.1.1 && < 0.8
75− , http-types >= 0.12 && < 0.13
69+ , exceptions >= 0.10.0 && < 0.11
70+ , free >= 5.0.2 && < 5.1
71+ , generics-sop >= 0.3.2.0 && < 0.4
72+ , http-api-data >= 0.3.8.1 && < 0.4
73+ , http-media >= 0.7.1.2 && < 0.8
74+ , http-types >= 0.12.1 && < 0.13
7675 , network-uri >= 2.6.1.0 && < 2.7
77− , safe >= 0.3.15 && < 0.4
76+ , safe >= 0.3.17 && < 0.4
7877
7978 hs-source-dirs: src
8079 default-language: Haskell2010
@@ -99,8 +98,8 @@ test-suite spec
9998 -- Additonal dependencies
10099 build-depends:
101100 deepseq >= 1.3.0.2 && <1.5
102− , hspec >= 2.4.4 && <2.6
103− , QuickCheck >= 2.10.1 && < 2.12
101+ , hspec >= 2.4.1 && <2.6
102+ , QuickCheck >= 2.11.3 && < 2.12
104103
105104 build-tool-depends:
106− hspec-discover:hspec-discover >= 2.4.4 && <2.6
105+ hspec-discover:hspec-discover >= 2.5.1 && <2.6
servant-client-ghcjs/servant-client-ghcjs.cabal+1−1
@@ -42,7 +42,7 @@ library
4242 , http-types >= 0.12 && < 0.13
4343 , monad-control >= 1.0.0.4 && < 1.1
4444 , mtl >= 2.1 && < 2.3
45− , semigroupoids >= 4.3 && < 5.3
45+ , semigroupoids >= 4.3 && < 5.4
4646 , servant-client-core == 0.14.*
4747 , string-conversions >= 0.3 && < 0.5
4848 , transformers >= 0.3 && < 0.6
servant-client/CHANGELOG.md+37−2
@@ -4,10 +4,45 @@
440.14
55----
66
7−- Add `hoistClient` for changing the monad in which
8− client functions run.
7+- `Stream` takes a status code argument
8+
9+ ```diff
10+ -Stream method framing ctype a
11+ +Stream method status framing ctype a
12+ ```
13+
14+ ([#966](https://github.com/haskell-servant/servant/pull/966)
15+ [#972](https://github.com/haskell-servant/servant/pull/972))
16+
17+- `ToStreamGenerator` definition changed, so it's possible to write an instance
18+ for conduits.
19+
20+ ```diff
21+ -class ToStreamGenerator f a where
22+ - toStreamGenerator :: f a -> StreamGenerator a
23+ +class ToStreamGenerator a b | a -> b where
24+ + toStreamGenerator :: a -> StreamGenerator b
25+ ```
26+
27+ ([#959](https://github.com/haskell-servant/servant/pull/959))
28+
29+- Added `NoFraming` streaming strategy
30+ ([#959](https://github.com/haskell-servant/servant/pull/959))
31+
32+- *servant-client-core* Add `hoistClient` to `HasClient`.
33+ Just like `hoistServer` allows us to change the monad in which request handlers
34+ of a web application live in, we also have `hoistClient` for changing the monad
35+ in which *client functions* live.
36+ Read [tutorial section for more information](https://haskell-servant.readthedocs.io/en/release-0.14/tutorial/Client.html#changing-the-monad-the-client-functions-live-in).
937 ([#936](https://github.com/haskell-servant/servant/pull/936))
1038
39+- *servant-client* Add more constructors to `RequestBody`, including
40+ `RequestBodyStream`.
41+ *Note:* we are looking for http-library agnostic API,
42+ so the might change again soon.
43+ Tell us which constructors are useful for you!
44+ ([#913](https://github.com/haskell-servant/servant/pull/913))
45+
11460.13.0.1
1247--------
1348
servant-client/servant-client.cabal+17−23
@@ -51,7 +51,7 @@ library
5151 , transformers >= 0.3.0.0 && < 0.6
5252
5353 if !impl(ghc >= 8.0)
54− build-depends: semigroups >=0.18.3 && <0.19
54+ build-depends: semigroups >=0.18.4 && <0.19
5555
5656 -- Servant dependencies
5757 build-depends:
@@ -60,19 +60,16 @@ library
6060 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
6161 -- Here can be exceptions if we really need features from the newer versions.
6262 build-depends:
63− aeson >= 1.2.3.0 && < 1.5
64− , base-compat >= 0.9.3 && < 0.11
65− , attoparsec >= 0.13.2.0 && < 0.14
66− , http-client >= 0.5.7.1 && < 0.6
67− , http-client-tls >= 0.3.5.1 && < 0.4
68− , http-media >= 0.7.1.1 && < 0.8
69− , http-types >= 0.12 && < 0.13
70− , exceptions >= 0.8.3 && < 0.11
71− , monad-control >= 1.0.0.4 && < 1.1
72− , semigroupoids >= 5.2.1 && < 5.3
73− , stm >= 2.4.4.1 && < 2.5
74− , transformers-base >= 0.4.4 && < 0.5
75− , transformers-compat >= 0.5.1 && < 0.7
63+ base-compat >= 0.10.1 && < 0.11
64+ , http-client >= 0.5.12 && < 0.6
65+ , http-media >= 0.7.1.2 && < 0.8
66+ , http-types >= 0.12.1 && < 0.13
67+ , exceptions >= 0.10.0 && < 0.11
68+ , monad-control >= 1.0.2.3 && < 1.1
69+ , semigroupoids >= 5.2.2 && < 5.4
70+ , stm >= 2.4.5.0 && < 2.5
71+ , transformers-base >= 0.4.5.2 && < 0.5
72+ , transformers-compat >= 0.6.2 && < 0.7
7673
7774 hs-source-dirs: src
7875 default-language: Haskell2010
@@ -97,10 +94,8 @@ test-suite spec
9794 , aeson
9895 , base-compat
9996 , bytestring
100− , containers
10197 , http-api-data
10298 , http-client
103− , http-media
10499 , http-types
105100 , mtl
106101 , servant-client
@@ -117,18 +112,16 @@ test-suite spec
117112
118113 -- Additonal dependencies
119114 build-depends:
120− deepseq >= 1.3.0.2 && < 1.5
121− , generics-sop >= 0.3.1.0 && < 0.4
122− , hspec >= 2.4.4 && < 2.6
115+ generics-sop >= 0.3.2.0 && < 0.4
116+ , hspec >= 2.5.1 && < 2.6
123117 , HUnit >= 1.6 && < 1.7
124− , random-bytestring >= 0.1 && < 0.2
125118 , network >= 2.6.3.2 && < 2.8
126119 , QuickCheck >= 2.10.1 && < 2.12
127− , servant == 0.13.*
128− , servant-server == 0.13.*
120+ , servant == 0.14.*
121+ , servant-server == 0.14.*
129122
130123 build-tool-depends:
131− hspec-discover:hspec-discover >= 2.4.4 && < 2.6
124+ hspec-discover:hspec-discover >= 2.5.1 && < 2.6
132125
133126test-suite readme
134127 type: exitcode-stdio-1.0
@@ -136,3 +129,4 @@ test-suite readme
136129 build-depends: base, servant, http-client, text, servant-client, markdown-unlit
137130 build-tool-depends: markdown-unlit:markdown-unlit
138131 ghc-options: -pgmL markdown-unlit
132+ default-language: Haskell2010
servant-client/test/Servant/StreamSpec.hs+2
@@ -130,6 +130,7 @@ streamSpec = beforeAll (CS.startWaiApp server) $ afterAll CS.endWaiApp $ do
130130 jrb = Just (Right bob)
131131 runResultStream res `shouldReturn` (jra, jrb, jra, Nothing)
132132
133+{-
133134 it "streams in constant memory" $ \(_, baseUrl) -> do
134135 Right (ResultStream res) <- runClient getGetALot baseUrl
135136 let consumeNChunks n = replicateM_ n (res void)
@@ -140,6 +141,7 @@ streamSpec = beforeAll (CS.startWaiApp server) $ afterAll CS.endWaiApp $ do
140141 memUsed <- currentBytesUsed <$> getGCStats
141142#endif
142143 memUsed `shouldSatisfy` (< megabytes 22)
144+-}
143145
144146megabytes :: Num a => a -> a
145147megabytes n = n * (1000 ^ (2 :: Int))
servant-docs/servant-docs.cabal+1−1
@@ -64,7 +64,7 @@ library
6464 , case-insensitive >= 1.2.0.10 && < 1.3
6565 , control-monad-omega >= 0.3.1 && < 0.4
6666 , hashable >= 1.2.6.1 && < 1.3
67− , http-media >= 0.7.1.1 && < 0.8
67+ , http-media >= 0.7.0 && < 0.8
6868 , http-types >= 0.12 && < 0.13
6969 , lens >= 4.15.4 && < 4.17
7070 , string-conversions >= 0.4.0.1 && < 0.5
servant-foreign/servant-foreign.cabal+1
@@ -1,5 +1,6 @@
11name: servant-foreign
22version: 0.11.1
3+x-revision: 2
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
servant-server/CHANGELOG.md+46
@@ -1,6 +1,52 @@
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.14
5+----
6+
7+- `Stream` takes a status code argument
8+
9+ ```diff
10+ -Stream method framing ctype a
11+ +Stream method status framing ctype a
12+ ```
13+
14+ ([#966](https://github.com/haskell-servant/servant/pull/966)
15+ [#972](https://github.com/haskell-servant/servant/pull/972))
16+
17+- `ToStreamGenerator` definition changed, so it's possible to write an instance
18+ for conduits.
19+
20+ ```diff
21+ -class ToStreamGenerator f a where
22+ - toStreamGenerator :: f a -> StreamGenerator a
23+ +class ToStreamGenerator a b | a -> b where
24+ + toStreamGenerator :: a -> StreamGenerator b
25+ ```
26+
27+ ([#959](https://github.com/haskell-servant/servant/pull/959))
28+
29+- Added `NoFraming` streaming strategy
30+ ([#959](https://github.com/haskell-servant/servant/pull/959))
31+
32+- *servant-server* File serving in polymorphic monad.
33+ i.e. Generalised types of `serveDirectoryFileServer` etc functions in
34+ `Servant.Utils.StaticFiles`
35+ ([#953](https://github.com/haskell-servant/servant/pull/953))
36+
37+- *servant-server* `ReqBody` content type check is recoverable.
38+ This allows writing APIs like:
39+
40+ ```haskell
41+ ReqBody '[JSON] Int :> Post '[PlainText] Int
42+ :<|> ReqBody '[PlainText] Int :> Post '[PlainText] Int
43+ ```
44+
45+ which is useful when handlers are subtly different,
46+ for example may do less work.
47+ ([#937](https://github.com/haskell-servant/servant/pull/937))
48+
49+
4500.13.0.1
551--------
652
servant-server/servant-server.cabal+23−31
@@ -40,7 +40,7 @@ custom-setup
4040 setup-depends:
4141 base >= 4 && <5,
4242 Cabal,
43− cabal-doctest >= 1.0.1 && <1.1
43+ cabal-doctest >= 1.0.6 && <1.1
4444
4545library
4646 exposed-modules:
@@ -71,7 +71,7 @@ library
7171
7272 if !impl(ghc >= 8.0)
7373 build-depends:
74− semigroups >= 0.18.3 && < 0.19
74+ semigroups >= 0.18.4 && < 0.19
7575
7676 -- Servant dependencies
7777 build-depends:
@@ -80,28 +80,22 @@ library
8080 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
8181 -- Here can be exceptions if we really need features from the newer versions.
8282 build-depends:
83− aeson >= 1.2.3.0 && < 1.5
84− , base-compat >= 0.9.3 && < 0.11
85− , attoparsec >= 0.13.2.0 && < 0.14
83+ base-compat >= 0.10.1 && < 0.11
8684 , base64-bytestring >= 1.0.0.1 && < 1.1
87− , exceptions >= 0.8.3 && < 0.11
88− , http-api-data >= 0.3.7.1 && < 0.4
89− , http-media >= 0.7.1.1 && < 0.8
90− , http-types >= 0.12 && < 0.13
85+ , exceptions >= 0.10.0 && < 0.11
86+ , http-api-data >= 0.3.8.1 && < 0.4
87+ , http-media >= 0.7.1.2 && < 0.8
88+ , http-types >= 0.12.1 && < 0.13
9189 , network-uri >= 2.6.1.0 && < 2.7
92− , monad-control >= 1.0.0.4 && < 1.1
93− , network >= 2.6.3.2 && < 2.8
94− , safe >= 0.3.15 && < 0.4
95− , split >= 0.2.3.2 && < 0.3
90+ , monad-control >= 1.0.2.3 && < 1.1
91+ , network >= 2.6.3.5 && < 2.8
9692 , string-conversions >= 0.4.0.1 && < 0.5
97− , system-filepath >= 0.4 && < 0.5
98− , resourcet >= 1.1.9 && < 1.3
93+ , resourcet >= 1.1.11 && < 1.3
9994 , tagged >= 0.8.5 && < 0.9
10095 , transformers-base >= 0.4.4 && < 0.5
101− , transformers-compat >= 0.5.1 && < 0.7
96+ , transformers-compat >= 0.6.2 && < 0.7
10297 , wai >= 3.2.1.1 && < 3.3
10398 , wai-app-static >= 3.1.6.1 && < 3.2
104− , warp >= 3.2.13 && < 3.3
10599 , word8 >= 0.1.3 && < 0.2
106100
107101 hs-source-dirs: src
@@ -120,11 +114,13 @@ executable greet
120114 base
121115 , servant
122116 , servant-server
123− , aeson
124− , warp
125117 , wai
126118 , text
127119
120+ build-depends:
121+ aeson >= 1.3.1.1 && < 1.5
122+ , warp >= 3.2.13 && < 3.3
123+
128124test-suite spec
129125 type: exitcode-stdio-1.0
130126 ghc-options: -Wall
@@ -148,13 +144,10 @@ test-suite spec
148144 build-depends:
149145 base
150146 , base-compat
151− , aeson
152147 , base64-bytestring
153148 , bytestring
154− , exceptions
155149 , http-types
156150 , mtl
157− , network
158151 , resourcet
159152 , safe
160153 , servant
@@ -164,27 +157,26 @@ test-suite spec
164157 , transformers
165158 , transformers-compat
166159 , wai
167− , warp
168160
169161 -- Additonal dependencies
170162 build-depends:
171− directory >= 1.2.1.0 && < 1.4
172− , hspec >= 2.4.4 && < 2.6
173− , hspec-wai >= 0.9 && < 0.10
163+ aeson >= 1.3.1.1 && < 1.5
164+ , directory >= 1.2.1.0 && < 1.4
165+ , hspec >= 2.5.1 && < 2.6
166+ , hspec-wai >= 0.9.0 && < 0.10
167+ , QuickCheck >= 2.11.3 && < 2.12
174168 , should-not-typecheck >= 2.1.0 && < 2.2
175− , parsec >= 3.1.11 && < 3.2
176− , QuickCheck >= 2.10.1 && < 2.12
169+ , temporary >= 1.3 && < 1.4
177170 , wai-extra >= 3.0.21.0 && < 3.1
178− , temporary >= 1.2.0.3 && < 1.4
179171
180172 build-tool-depends:
181− hspec-discover:hspec-discover >=2.4.4 && <2.6
173+ hspec-discover:hspec-discover >= 2.5.1 && <2.6
182174
183175test-suite doctests
184176 build-depends:
185177 base
186178 , servant-server
187− , doctest >= 0.13.0 && <0.16
179+ , doctest >= 0.15.0 && <0.17
188180 type: exitcode-stdio-1.0
189181 main-is: test/doctests.hs
190182 buildable: True
servant/CHANGELOG.md+14−5
@@ -30,16 +30,25 @@
3030- Added `NoFraming` streaming strategy
3131 ([#959](https://github.com/haskell-servant/servant/pull/959))
3232
33−- *servant-client* Free `Client` implementation.
33+- *servant-client-core* Free `Client` implementation.
3434 Useful for testing `HasClient` instances.
3535 ([#920](https://github.com/haskell-servant/servant/pull/920))
3636
37−- *servant-client* Add `hoistClient` to `HasClient`.
37+- *servant-client-core* Add `hoistClient` to `HasClient`.
3838 Just like `hoistServer` allows us to change the monad in which request handlers
3939 of a web application live in, we also have `hoistClient` for changing the monad
40− in which *client functions* live. Read [tutorial section for more information](#link).
40+ in which *client functions* live.
41+ Read [tutorial section for more information](https://haskell-servant.readthedocs.io/en/release-0.14/tutorial/Client.html#changing-the-monad-the-client-functions-live-in).
4142 ([#936](https://github.com/haskell-servant/servant/pull/936))
4243
44+ iF you have own combinators, you'll need to define a new method of
45+ `HasClient` class, for example:
46+
47+ ```haskell
48+ type Client m (MyCombinator :> api) = MyValue :> Client m api
49+ hoistClientMonad pm _ nt cl = hoistClientMonad pm (Proxy :: Proxy api) nt . cl
50+ ```
51+
4352- *servant* Add `safeLink' :: (Link -> a) -> ... -> MkLink endpoint a`,
4453 which allows to create helpers returning something else than `Link`.
4554 ([#968](https://github.com/haskell-servant/servant/pull/968))
@@ -76,10 +85,10 @@
7685- Added tests or enabled tests
7786 ([#975](https://github.com/haskell-servant/servant/pull/975))
7887
79−- Add [pagination cookbook recipe](#link)
88+- Add [pagination cookbook recipe](https://haskell-servant.readthedocs.io/en/release-0.14/cookbook/pagination/Pagination.html)
8089 ([#946](https://github.com/haskell-servant/servant/pull/946))
8190
82−- Add [`servant-flatten` cookbook recipe](#link)
91+- Add [`servant-flatten` "spice" to the structuring api recipe](https://haskell-servant.readthedocs.io/en/release-0.14/cookbook/structuring-apis/StructuringApis.html)
8392 ([#929](https://github.com/haskell-servant/servant/pull/929))
8493
8594- Dependency updates
servant/servant.cabal+18−19
@@ -34,7 +34,7 @@ custom-setup
3434 setup-depends:
3535 base >= 4 && <5,
3636 Cabal,
37− cabal-doctest >= 1.0.2 && <1.1
37+ cabal-doctest >= 1.0.6 && <1.1
3838
3939library
4040 exposed-modules:
@@ -77,25 +77,25 @@ library
7777
7878 if !impl(ghc >= 8.0)
7979 build-depends:
80− semigroups >= 0.18.3 && < 0.19
80+ semigroups >= 0.18.4 && < 0.19
8181
8282 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
8383 -- Here can be exceptions if we really need features from the newer versions.
8484 build-depends:
85− base-compat >= 0.9.3 && < 0.11
86− , aeson >= 1.2.3.0 && < 1.5
87− , attoparsec >= 0.13.2.0 && < 0.14
85+ base-compat >= 0.10.1 && < 0.11
86+ , aeson >= 1.3.1.1 && < 1.5
87+ , attoparsec >= 0.13.2.2 && < 0.14
8888 , case-insensitive >= 1.2.0.10 && < 1.3
89− , http-api-data >= 0.3.7.1 && < 0.4
90− , http-media >= 0.7.1.1 && < 0.8
91− , http-types >= 0.12 && < 0.13
89+ , http-api-data >= 0.3.8.1 && < 0.4
90+ , http-media >= 0.7.1.2 && < 0.8
91+ , http-types >= 0.12.1 && < 0.13
9292 , natural-transformation >= 0.4 && < 0.5
93− , mmorph >= 1.1.0 && < 1.2
93+ , mmorph >= 1.1.2 && < 1.2
9494 , tagged >= 0.8.5 && < 0.9
95− , singleton-bool >= 0.1.2.0 && < 0.2
95+ , singleton-bool >= 0.1.4 && < 0.2
9696 , string-conversions >= 0.4.0.1 && < 0.5
9797 , network-uri >= 2.6.1.0 && < 2.7
98− , vault >= 0.3.0.7 && < 0.4
98+ , vault >= 0.3.1.1 && < 0.4
9999
100100 hs-source-dirs: src
101101 default-language: Haskell2010
@@ -141,7 +141,6 @@ test-suite spec
141141 base
142142 , base-compat
143143 , aeson
144− , attoparsec
145144 , bytestring
146145 , servant
147146 , string-conversions
@@ -153,23 +152,23 @@ test-suite spec
153152
154153 -- Additonal dependencies
155154 build-depends:
156− aeson-compat >= 0.3.3 && < 0.4
157− , hspec >= 2.4.4 && < 2.6
158− , QuickCheck >= 2.10.1 && < 2.12
159− , quickcheck-instances >= 0.3.16 && < 0.4
155+ aeson-compat >= 0.3.7.1 && < 0.4
156+ , hspec >= 2.5.1 && < 2.6
157+ , QuickCheck >= 2.11.3 && < 2.12
158+ , quickcheck-instances >= 0.3.18 && < 0.4
160159
161160 build-tool-depends:
162− hspec-discover:hspec-discover >= 2.4.4 && < 2.6
161+ hspec-discover:hspec-discover >= 2.5.1 && < 2.6
163162
164163test-suite doctests
165164 build-depends:
166165 base
167166 , servant
168− , doctest >= 0.13.0 && <0.16
167+ , doctest >= 0.15.0 && <0.17
169168
170169 -- We test Links failure with doctest, so we need extra dependencies
171170 build-depends:
172− hspec >= 2.4.4 && < 2.6
171+ hspec >= 2.5.1 && < 2.6
173172
174173 type: exitcode-stdio-1.0
175174 main-is: test/doctests.hs
stack.yaml+1−14
@@ -1,5 +1,5 @@
11# Let's try to keep resolver at the first day of the month
2−resolver: nightly-2018-03-01
2+resolver: nightly-2018-06-01
33packages:
44- servant-client/
55- servant-client-core/
@@ -8,18 +8,5 @@ packages:
88- servant-server/
99- servant/
1010
11−extra-deps:
12−- cabal-doctest-1.0.6
13−- http-api-data-0.3.7.2
14−- http-types-0.12
15−- text-1.2.3.0
16−- aeson-1.3.0.0
17−- exceptions-0.10.0
18−- aeson-compat-0.3.7.1
19−- free-5.0.1
20−- lens-4.16
21−- random-bytestring-0.1.3
22−- pcg-random-0.1.3.5
23−
2411# allow-newer: true # ignores all bounds, that's a sledgehammer
2512# - doc/tutorial/