Compare commits
22 Commits
master
...
release-0.
Author | SHA1 | Date |
---|---|---|
Oleg Grenrus | c3caa14955 | |
Oleg Grenrus | ee8bb3b1d0 | |
Oleg Grenrus | f4f7db895e | |
Oleg Grenrus | 4d6203a796 | |
Oleg Grenrus | 3bb043d62a | |
Oleg Grenrus | 8605040947 | |
Oleg Grenrus | 0f0c8f7f90 | |
Oleg Grenrus | 903ae74630 | |
Oleg Grenrus | 3550d4b6fb | |
Oleg Grenrus | a49b53c675 | |
Oleg Grenrus | 22146631d4 | |
Oleg Grenrus | 7176917f71 | |
Oleg Grenrus | e3be4f789b | |
Oleg Grenrus | f9c6ed4433 | |
Oleg Grenrus | 0881c1822a | |
Oleg Grenrus | 67698db217 | |
Oleg Grenrus | c34bd1cfde | |
Oleg Grenrus | 1d55429f25 | |
Oleg Grenrus | e52777c3a4 | |
Oleg Grenrus | 547820a6d4 | |
Oleg Grenrus | be5f0baf8d | |
Oleg Grenrus | 2b771af434 |
61
.travis.yml
61
.travis.yml
|
@ -14,6 +14,7 @@ branches:
|
|||
only:
|
||||
- master
|
||||
- release-0.12
|
||||
- release-0.13
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
@ -33,18 +34,21 @@ before_cache:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- compiler: "ghc-7.8.4"
|
||||
- compiler: "ghc-8.4.1"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-7.10.3"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-8.0.2"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
|
||||
addons: {apt: {packages: [ghc-ppa-tools,ghc-8.4.1], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-8.2.2"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
|
||||
addons: {apt: {packages: [ghc-ppa-tools,ghc-8.2.2], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-8.0.2"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,ghc-8.0.2], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-7.10.3"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,ghc-7.10.3], sources: [hvr-ghc]}}
|
||||
- compiler: "ghc-7.8.4"
|
||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||
addons: {apt: {packages: [ghc-ppa-tools,ghc-7.8.4], sources: [hvr-ghc]}}
|
||||
|
||||
before_install:
|
||||
- HC=${CC}
|
||||
|
@ -56,6 +60,17 @@ before_install:
|
|||
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
|
||||
- echo $HCNUMVER
|
||||
|
||||
# Let's download "better" cabal
|
||||
- "curl -L http://oleg.fi/cabal-grayjay-buildable-fix.xz | xz -d > $HOME/.local/bin/cabal"
|
||||
- |
|
||||
if [ "$(cd $HOME/.local/bin && sha256sum cabal)" != "e281e9466b8eef30ac0d1371e8ea83c9d2e856bda4714a728ac474138b09b20f cabal" ]; then
|
||||
rm -f $HOME/.local/bin/cabal;
|
||||
sha256sum $HOME/.local/bin/cabal;
|
||||
false;
|
||||
else
|
||||
chmod a+x $HOME/.local/bin/cabal;
|
||||
fi
|
||||
|
||||
install:
|
||||
- cabal --version
|
||||
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
||||
|
@ -69,9 +84,9 @@ install:
|
|||
- rm -fv cabal.project cabal.project.local
|
||||
- "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
|
||||
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
|
||||
- "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"
|
||||
- "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"
|
||||
- "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
|
||||
- "echo 'allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens' >> cabal.project"
|
||||
- "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"
|
||||
- cat cabal.project
|
||||
- if [ -f "servant/configure.ac" ]; then
|
||||
(cd "servant" && autoreconf -i);
|
||||
|
@ -94,18 +109,6 @@ install:
|
|||
- if [ -f "doc/tutorial/configure.ac" ]; then
|
||||
(cd "doc/tutorial" && autoreconf -i);
|
||||
fi
|
||||
- if [ -f "doc/cookbook/db-postgres-pool/configure.ac" ]; then
|
||||
(cd "doc/cookbook/db-postgres-pool" && autoreconf -i);
|
||||
fi
|
||||
- if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then
|
||||
(cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i);
|
||||
fi
|
||||
- if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then
|
||||
(cd "doc/cookbook/db-sqlite-simple" && autoreconf -i);
|
||||
fi
|
||||
- if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then
|
||||
(cd "doc/cookbook/basic-auth" && autoreconf -i);
|
||||
fi
|
||||
- if [ -f "doc/cookbook/https/configure.ac" ]; then
|
||||
(cd "doc/cookbook/https" && autoreconf -i);
|
||||
fi
|
||||
|
@ -119,7 +122,7 @@ install:
|
|||
(cd "doc/cookbook/file-upload" && autoreconf -i);
|
||||
fi
|
||||
- rm -f cabal.project.freeze
|
||||
- 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
|
||||
- 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
|
||||
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
|
||||
|
||||
# Here starts the actual work to be performed for the package under test;
|
||||
|
@ -134,22 +137,18 @@ script:
|
|||
- (cd "servant-foreign" && cabal sdist)
|
||||
- (cd "servant-server" && cabal sdist)
|
||||
- (cd "doc/tutorial" && cabal sdist)
|
||||
- (cd "doc/cookbook/db-postgres-pool" && cabal sdist)
|
||||
- (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist)
|
||||
- (cd "doc/cookbook/db-sqlite-simple" && cabal sdist)
|
||||
- (cd "doc/cookbook/basic-auth" && cabal sdist)
|
||||
- (cd "doc/cookbook/https" && cabal sdist)
|
||||
- (cd "doc/cookbook/structuring-apis" && cabal sdist)
|
||||
- (cd "doc/cookbook/using-custom-monad" && cabal sdist)
|
||||
- (cd "doc/cookbook/file-upload" && cabal sdist)
|
||||
- echo -en 'travis_fold:end:sdist\\r'
|
||||
- echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
|
||||
- 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}/
|
||||
- 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}/
|
||||
- cd ${DISTDIR} || false
|
||||
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
|
||||
- "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"
|
||||
- "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"
|
||||
- "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
|
||||
- "echo 'allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens' >> cabal.project"
|
||||
- "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"
|
||||
- cat cabal.project
|
||||
- echo -en 'travis_fold:end:unpack\\r'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
folds: all-but-test
|
||||
branches: master release-0.12
|
||||
branches: master release-0.12 release-0.13
|
||||
|
||||
-- We have inplace packages (servant-js) so we skip installing dependencies in a separate step
|
||||
install-dependencies-step: False
|
||||
|
|
|
@ -5,9 +5,28 @@ packages: servant/
|
|||
servant-foreign/
|
||||
servant-server/
|
||||
doc/tutorial/
|
||||
doc/cookbook/*/*.cabal
|
||||
|
||||
allow-newer: servant-js:servant-foreign, servant-auth-server:http-types, servant-multipart:lens
|
||||
-- doc/cookbook/*/*.cabal
|
||||
|
||||
-- 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
|
||||
|
||||
|
||||
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
|
||||
|
||||
constraints:
|
||||
-- see https://github.com/haskell-infra/hackage-trustees/issues/119
|
||||
|
|
|
@ -8,7 +8,7 @@ author: Servant Contributors
|
|||
maintainer: haskell-servant-maintainers@googlegroups.com
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
|
||||
|
||||
executable cookbook-file-upload
|
||||
main-is: FileUpload.lhs
|
||||
|
|
|
@ -8,7 +8,7 @@ author: Servant Contributors
|
|||
maintainer: haskell-servant-maintainers@googlegroups.com
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
|
||||
|
||||
executable cookbook-https
|
||||
main-is: Https.lhs
|
||||
|
|
|
@ -8,7 +8,7 @@ author: Servant Contributors
|
|||
maintainer: haskell-servant-maintainers@googlegroups.com
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
|
||||
|
||||
executable cookbook-structuring-apis
|
||||
main-is: StructuringApis.lhs
|
||||
|
|
|
@ -8,7 +8,7 @@ author: Servant Contributors
|
|||
maintainer: haskell-servant-maintainers@googlegroups.com
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2
|
||||
tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1
|
||||
|
||||
executable cookbook-using-custom-monad
|
||||
main-is: UsingCustomMonad.lhs
|
||||
|
|
|
@ -13,10 +13,11 @@ maintainer: haskell-servant-maintainers@googlegroups.com
|
|||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
extra-source-files:
|
||||
static/index.html
|
||||
static/ui.js
|
||||
|
@ -34,7 +35,7 @@ library
|
|||
-- Packages `servant` depends on.
|
||||
-- We don't need to specify bounds here as this package is never released.
|
||||
build-depends:
|
||||
base >= 4.7 && <4.11
|
||||
base >= 4.7 && <4.12
|
||||
, aeson
|
||||
, aeson-compat
|
||||
, attoparsec
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client-core/CHANGELOG.md)
|
||||
[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.13.0.1
|
||||
--------
|
||||
|
||||
- Support `base-compat-0.10`
|
||||
|
||||
|
||||
0.13
|
||||
----
|
||||
|
||||
- Streaming endpoint support.
|
||||
([#836](https://github.com/haskell-servant/servant/pull/836))
|
||||
- *servant* Add `Servant.API.Modifiers`
|
||||
([#873](https://github.com/haskell-servant/servant/pull/873))
|
||||
|
||||
0.12
|
||||
----
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: servant-client-core
|
||||
version: 0.12
|
||||
version: 0.13.0.1
|
||||
synopsis: Core functionality and class for client function generation for servant APIs
|
||||
description:
|
||||
This library provides backend-agnostic generation of client functions. For
|
||||
|
@ -19,10 +19,11 @@ extra-source-files:
|
|||
CHANGELOG.md
|
||||
README.md
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
|
@ -45,7 +46,7 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10.4.0 && < 0.11
|
||||
, containers >= 0.5.5.1 && < 0.6
|
||||
, mtl >= 2.1 && < 2.3
|
||||
|
@ -57,17 +58,17 @@ library
|
|||
|
||||
-- Servant dependencies
|
||||
build-depends:
|
||||
servant == 0.12.*
|
||||
servant == 0.13.*
|
||||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
base-compat >= 0.9.3 && < 0.10
|
||||
base-compat >= 0.9.3 && < 0.11
|
||||
, base64-bytestring >= 1.0.0.1 && < 1.1
|
||||
, exceptions >= 0.8.3 && < 0.9
|
||||
, exceptions >= 0.8.3 && < 0.11
|
||||
, generics-sop >= 0.3.1.0 && < 0.4
|
||||
, http-api-data >= 0.3.7.1 && < 0.4
|
||||
, http-media >= 0.7.1.1 && < 0.8
|
||||
, http-media >= 0.7.0 && < 0.8
|
||||
, http-types >= 0.12 && < 0.13
|
||||
, network-uri >= 2.6.1.0 && < 2.7
|
||||
, safe >= 0.3.15 && < 0.4
|
||||
|
@ -95,8 +96,8 @@ test-suite spec
|
|||
-- Additonal dependencies
|
||||
build-depends:
|
||||
deepseq >= 1.3.0.2 && <1.5
|
||||
, hspec >= 2.4.4 && <2.5
|
||||
, hspec >= 2.4.4 && <2.6
|
||||
, QuickCheck >= 2.10.1 && < 2.12
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >= 2.4.4 && <2.5
|
||||
hspec-discover:hspec-discover >= 2.4.4 && <2.6
|
||||
|
|
|
@ -21,8 +21,8 @@ import Control.Concurrent (newMVar, modifyMVar)
|
|||
import Data.Foldable (toList)
|
||||
import qualified Data.ByteString.Lazy as BL
|
||||
import Data.List (foldl')
|
||||
import Data.Monoid ((<>))
|
||||
import Data.Proxy (Proxy (Proxy))
|
||||
import Data.Semigroup ((<>))
|
||||
import Data.Sequence (fromList)
|
||||
import Data.String (fromString)
|
||||
import Data.Text (Text, pack)
|
||||
|
@ -34,7 +34,7 @@ import Servant.API ((:<|>) ((:<|>)), (:>),
|
|||
BuildHeadersTo (..),
|
||||
BuildFromStream (..),
|
||||
ByteStringParser (..),
|
||||
Capture, CaptureAll,
|
||||
Capture', CaptureAll,
|
||||
Description, EmptyAPI,
|
||||
FramingUnrender (..),
|
||||
Header', Headers (..),
|
||||
|
@ -155,9 +155,9 @@ instance RunClient m => HasClient m EmptyAPI where
|
|||
-- > getBook = client myApi
|
||||
-- > -- then you can just use "getBook" to query that endpoint
|
||||
instance (KnownSymbol capture, ToHttpApiData a, HasClient m api)
|
||||
=> HasClient m (Capture capture a :> api) where
|
||||
=> HasClient m (Capture' mods capture a :> api) where
|
||||
|
||||
type Client m (Capture capture a :> api) =
|
||||
type Client m (Capture' mods capture a :> api) =
|
||||
a -> Client m api
|
||||
|
||||
clientWithRoute pm Proxy req val =
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: servant-client-ghcjs
|
||||
version: 0.11
|
||||
version: 0.13
|
||||
synopsis: automatical derivation of querying functions for servant webservices for ghcjs
|
||||
description:
|
||||
This library lets you automatically derive Haskell functions that
|
||||
|
@ -31,11 +31,11 @@ library
|
|||
Servant.Client.Ghcjs
|
||||
Servant.Client.Internal.XhrClient
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10 && < 0.11
|
||||
, case-insensitive >= 1.2.0.0 && < 1.3.0.0
|
||||
, containers >= 0.5 && < 0.6
|
||||
, exceptions >= 0.8 && < 0.9
|
||||
, exceptions >= 0.8 && < 0.11
|
||||
, ghcjs-base >= 0.2.0.0 && < 0.3.0.0
|
||||
, ghcjs-prim >= 0.1.0.0 && < 0.2.0.0
|
||||
, http-media >= 0.6.2 && < 0.8
|
||||
|
@ -43,7 +43,7 @@ library
|
|||
, monad-control >= 1.0.0.4 && < 1.1
|
||||
, mtl >= 2.1 && < 2.3
|
||||
, semigroupoids >= 4.3 && < 5.3
|
||||
, servant-client-core >= 0.12 && < 0.13
|
||||
, servant-client-core == 0.13.*
|
||||
, string-conversions >= 0.3 && < 0.5
|
||||
, transformers >= 0.3 && < 0.6
|
||||
, transformers-base >= 0.4.4 && < 0.5
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-client/CHANGELOG.md)
|
||||
[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.13.0.1
|
||||
--------
|
||||
|
||||
- Support `base-compat-0.10`
|
||||
|
||||
0.13
|
||||
----
|
||||
|
||||
- Streaming endpoint support.
|
||||
([#836](https://github.com/haskell-servant/servant/pull/836))
|
||||
- *servant* Add `Servant.API.Modifiers`
|
||||
([#873](https://github.com/haskell-servant/servant/pull/873))
|
||||
- *servant-client* Support `http-client`’s `CookieJar`
|
||||
([#897](https://github.com/haskell-servant/servant/pull/897)
|
||||
[#883](https://github.com/haskell-servant/servant/pull/883))
|
||||
|
||||
0.12.0.1
|
||||
--------
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name: servant-client
|
||||
version: 0.12.0.1
|
||||
version: 0.13.0.1
|
||||
x-revision: 2
|
||||
synopsis: automatical derivation of querying functions for servant webservices
|
||||
description:
|
||||
This library lets you derive automatically Haskell functions that
|
||||
|
@ -17,10 +18,11 @@ category: Servant, Web
|
|||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
homepage: http://haskell-servant.readthedocs.org/
|
||||
Bug-reports: http://github.com/haskell-servant/servant/issues
|
||||
extra-source-files:
|
||||
|
@ -41,7 +43,7 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10.4.0 && < 0.11
|
||||
, containers >= 0.5.5.1 && < 0.6
|
||||
, mtl >= 2.1 && < 2.3
|
||||
|
@ -54,24 +56,24 @@ library
|
|||
|
||||
-- Servant dependencies
|
||||
build-depends:
|
||||
servant-client-core == 0.12.*
|
||||
servant-client-core == 0.13.*
|
||||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
aeson >= 1.2.3.0 && < 1.3
|
||||
, base-compat >= 0.9.3 && < 0.10
|
||||
aeson >= 1.2.3.0 && < 1.5
|
||||
, base-compat >= 0.9.3 && < 0.11
|
||||
, attoparsec >= 0.13.2.0 && < 0.14
|
||||
, http-client >= 0.5.7.1 && < 0.6
|
||||
, http-client-tls >= 0.3.5.1 && < 0.4
|
||||
, http-media >= 0.7.1.1 && < 0.8
|
||||
, http-media >= 0.7.0 && < 0.8
|
||||
, http-types >= 0.12 && < 0.13
|
||||
, exceptions >= 0.8.3 && < 0.9
|
||||
, exceptions >= 0.8.3 && < 0.11
|
||||
, monad-control >= 1.0.0.4 && < 1.1
|
||||
, semigroupoids >= 5.2.1 && < 5.3
|
||||
, stm >= 2.4.4.1 && < 2.5
|
||||
, transformers-base >= 0.4.4 && < 0.5
|
||||
, transformers-compat >= 0.5.1 && < 0.6
|
||||
, transformers-compat >= 0.5.1 && < 0.7
|
||||
|
||||
hs-source-dirs: src
|
||||
default-language: Haskell2010
|
||||
|
@ -110,16 +112,20 @@ test-suite spec
|
|||
, wai
|
||||
, warp
|
||||
|
||||
if !impl(ghc >= 8.0)
|
||||
build-depends:
|
||||
semigroups
|
||||
|
||||
-- Additonal dependencies
|
||||
build-depends:
|
||||
deepseq >= 1.3.0.2 && < 1.5
|
||||
, generics-sop >= 0.3.1.0 && < 0.4
|
||||
, hspec >= 2.4.4 && < 2.5
|
||||
, hspec >= 2.4.4 && < 2.6
|
||||
, HUnit >= 1.6 && < 1.7
|
||||
, network >= 2.6.3.2 && < 2.7
|
||||
, network >= 2.6.3.2 && < 2.8
|
||||
, QuickCheck >= 2.10.1 && < 2.12
|
||||
, servant == 0.12.*
|
||||
, servant-server == 0.12.*
|
||||
, servant == 0.13.*
|
||||
, servant-server == 0.13.*
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >= 2.4.4 && < 2.5
|
||||
hspec-discover:hspec-discover >= 2.4.4 && < 2.6
|
||||
|
|
|
@ -37,7 +37,8 @@ import Control.Monad.Error.Class (throwError)
|
|||
import Data.Aeson
|
||||
import Data.Char (chr, isPrint)
|
||||
import Data.Foldable (forM_)
|
||||
import Data.Monoid hiding (getLast)
|
||||
import Data.Semigroup ((<>))
|
||||
import Data.Monoid ()
|
||||
import Data.Proxy
|
||||
import qualified Generics.SOP as SOP
|
||||
import GHC.Generics (Generic)
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md)
|
||||
[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.11.2
|
||||
------
|
||||
|
||||
* Allow `servant-0.13`:
|
||||
- Doesn't have instances for streaming.
|
||||
- Servant.API.Modifiers extra information isn't used.
|
||||
|
||||
0.11.1
|
||||
------
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name: servant-docs
|
||||
version: 0.11.1
|
||||
version: 0.11.2
|
||||
x-revision: 3
|
||||
synopsis: generate API docs for your servant webservice
|
||||
description:
|
||||
Library for generating API docs from a servant API definition.
|
||||
|
@ -16,10 +17,11 @@ category: Servant, Web
|
|||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
homepage: http://haskell-servant.readthedocs.org/
|
||||
Bug-reports: http://github.com/haskell-servant/servant/issues
|
||||
extra-source-files:
|
||||
|
@ -41,7 +43,7 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10.4.0 && < 0.11
|
||||
, text >= 1.2.3.0 && < 1.3
|
||||
|
||||
|
@ -51,18 +53,18 @@ library
|
|||
|
||||
-- Servant dependencies
|
||||
build-depends:
|
||||
servant == 0.12.*
|
||||
servant == 0.13.*
|
||||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
aeson >= 1.2.3.0 && < 1.3
|
||||
aeson >= 1.2.3.0 && < 1.5
|
||||
, aeson-pretty >= 0.8.5 && < 0.9
|
||||
, base-compat >= 0.9.3 && < 0.10
|
||||
, base-compat >= 0.9.3 && < 0.11
|
||||
, case-insensitive >= 1.2.0.10 && < 1.3
|
||||
, control-monad-omega >= 0.3.1 && < 0.4
|
||||
, hashable >= 1.2.6.1 && < 1.3
|
||||
, http-media >= 0.7.1.1 && < 0.8
|
||||
, http-media >= 0.7.0 && < 0.8
|
||||
, http-types >= 0.12 && < 0.13
|
||||
, lens >= 4.15.4 && < 4.17
|
||||
, string-conversions >= 0.4.0.1 && < 0.5
|
||||
|
@ -108,7 +110,7 @@ test-suite spec
|
|||
|
||||
-- Additonal dependencies
|
||||
build-depends:
|
||||
hspec >= 2.4.4 && < 2.5
|
||||
hspec >= 2.4.4 && < 2.6
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.5
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.6
|
||||
|
|
|
@ -795,7 +795,7 @@ instance HasDocs EmptyAPI where
|
|||
-- | @"books" :> 'Capture' "isbn" Text@ will appear as
|
||||
-- @/books/:isbn@ in the docs.
|
||||
instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
|
||||
=> HasDocs (Capture sym a :> api) where
|
||||
=> HasDocs (Capture' mods sym a :> api) where
|
||||
|
||||
docsFor Proxy (endpoint, action) =
|
||||
docsFor subApiP (endpoint', action')
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-foreign/CHANGELOG.md)
|
||||
[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.11.1
|
||||
------
|
||||
|
||||
- Add missing `Semigroup` instances
|
||||
|
||||
0.11
|
||||
----
|
||||
|
||||
### Breaking changes
|
||||
|
||||
* Make foreign client Header arguments have the representation of 'Maybe' in those languages
|
||||
- *servant* Add `Servant.API.Modifiers`
|
||||
([#873](https://github.com/haskell-servant/servant/pull/873))
|
||||
- Make foreign client Header arguments have the representation of 'Maybe' in those languages
|
||||
([#843](https://github.com/haskell-servant/servant/pull/843))
|
||||
|
||||
0.10.2
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name: servant-foreign
|
||||
version: 0.11
|
||||
version: 0.11.1
|
||||
x-revision: 1
|
||||
synopsis: Helpers for generating clients for servant APIs in any programming language
|
||||
description:
|
||||
Helper types and functions for generating client functions for servant APIs in any programming language
|
||||
|
@ -23,10 +24,11 @@ extra-source-files:
|
|||
README.md
|
||||
bug-reports: http://github.com/haskell-servant/servant/issues
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
|
@ -42,17 +44,21 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && <4.11
|
||||
base >= 4.7 && <4.12
|
||||
, text >= 1.2.3.0 && < 1.3
|
||||
|
||||
if !impl(ghc >= 8.0)
|
||||
build-depends:
|
||||
semigroups >=0.18.3 && <0.19
|
||||
|
||||
-- Servant dependencies
|
||||
build-depends:
|
||||
servant == 0.12.*
|
||||
servant == 0.13.*
|
||||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
base-compat >= 0.9.3 && <0.10
|
||||
base-compat >= 0.9.3 && <0.11
|
||||
, lens >= 4.15.4 && <4.17
|
||||
, http-types >= 0.12 && < 0.13
|
||||
|
||||
|
@ -79,8 +85,8 @@ test-suite spec
|
|||
|
||||
-- Additonal dependencies
|
||||
build-depends:
|
||||
hspec >= 2.4.4 && <2.5
|
||||
hspec >= 2.4.4 && <2.6
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.5
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.6
|
||||
default-language: Haskell2010
|
||||
|
|
|
@ -27,6 +27,7 @@ import Control.Lens (makePrisms, makeLenses, Getter, (&), (<>~), (%~),
|
|||
(.~))
|
||||
import Data.Data (Data)
|
||||
import Data.Proxy
|
||||
import Data.Semigroup (Semigroup)
|
||||
import Data.String
|
||||
import Data.Text
|
||||
import Data.Typeable (Typeable)
|
||||
|
@ -38,12 +39,12 @@ import Servant.API.TypeLevel
|
|||
import Servant.API.Modifiers (RequiredArgument)
|
||||
|
||||
newtype FunctionName = FunctionName { unFunctionName :: [Text] }
|
||||
deriving (Data, Show, Eq, Monoid, Typeable)
|
||||
deriving (Data, Show, Eq, Semigroup, Monoid, Typeable)
|
||||
|
||||
makePrisms ''FunctionName
|
||||
|
||||
newtype PathSegment = PathSegment { unPathSegment :: Text }
|
||||
deriving (Data, Show, Eq, IsString, Monoid, Typeable)
|
||||
deriving (Data, Show, Eq, IsString, Semigroup, Monoid, Typeable)
|
||||
|
||||
makePrisms ''PathSegment
|
||||
|
||||
|
@ -195,8 +196,8 @@ instance HasForeign lang ftype EmptyAPI where
|
|||
foreignFor Proxy Proxy Proxy _ = EmptyForeignAPI
|
||||
|
||||
instance (KnownSymbol sym, HasForeignType lang ftype t, HasForeign lang ftype api)
|
||||
=> HasForeign lang ftype (Capture sym t :> api) where
|
||||
type Foreign ftype (Capture sym t :> api) = Foreign ftype api
|
||||
=> HasForeign lang ftype (Capture' mods sym t :> api) where
|
||||
type Foreign ftype (Capture' mods sym t :> api) = Foreign ftype api
|
||||
|
||||
foreignFor lang Proxy Proxy req =
|
||||
foreignFor lang Proxy (Proxy :: Proxy api) $
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-server/CHANGELOG.md)
|
||||
[Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.13.0.1
|
||||
--------
|
||||
|
||||
- Support `base-compat-0.10`
|
||||
|
||||
0.13
|
||||
----
|
||||
|
||||
- Streaming endpoint support.
|
||||
([#836](https://github.com/haskell-servant/servant/pull/836))
|
||||
- *servant* Add `Servant.API.Modifiers`
|
||||
([#873](https://github.com/haskell-servant/servant/pull/873))
|
||||
|
||||
0.12
|
||||
----
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name: servant-server
|
||||
version: 0.12
|
||||
version: 0.13.0.1
|
||||
x-revision: 2
|
||||
synopsis: A family of combinators for defining webservices APIs and serving them
|
||||
description:
|
||||
A family of combinators for defining webservices APIs and serving them
|
||||
|
@ -22,10 +23,11 @@ category: Servant, Web
|
|||
build-type: Custom
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
extra-source-files:
|
||||
include/*.h
|
||||
CHANGELOG.md
|
||||
|
@ -60,7 +62,7 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10.4.0 && < 0.11
|
||||
, containers >= 0.5.5.1 && < 0.6
|
||||
, mtl >= 2.1 && < 2.3
|
||||
|
@ -68,32 +70,36 @@ library
|
|||
, transformers >= 0.3.0.0 && < 0.6
|
||||
, filepath >= 1.3.0.2 && < 1.5
|
||||
|
||||
if !impl(ghc >= 8.0)
|
||||
build-depends:
|
||||
semigroups >= 0.18.3 && < 0.19
|
||||
|
||||
-- Servant dependencies
|
||||
build-depends:
|
||||
servant == 0.12.*
|
||||
servant == 0.13.*
|
||||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
aeson >= 1.2.3.0 && < 1.3
|
||||
, base-compat >= 0.9.3 && < 0.10
|
||||
aeson >= 1.2.3.0 && < 1.5
|
||||
, base-compat >= 0.9.3 && < 0.11
|
||||
, attoparsec >= 0.13.2.0 && < 0.14
|
||||
, base64-bytestring >= 1.0.0.1 && < 1.1
|
||||
, exceptions >= 0.8.3 && < 0.9
|
||||
, exceptions >= 0.8.3 && < 0.11
|
||||
, http-api-data >= 0.3.7.1 && < 0.4
|
||||
, http-media >= 0.7.1.1 && < 0.8
|
||||
, http-media >= 0.7.0 && < 0.8
|
||||
, http-types >= 0.12 && < 0.13
|
||||
, network-uri >= 2.6.1.0 && < 2.7
|
||||
, monad-control >= 1.0.0.4 && < 1.1
|
||||
, network >= 2.6.3.2 && < 2.7
|
||||
, network >= 2.6.3.2 && < 2.8
|
||||
, safe >= 0.3.15 && < 0.4
|
||||
, split >= 0.2.3.2 && < 0.3
|
||||
, string-conversions >= 0.4.0.1 && < 0.5
|
||||
, system-filepath >= 0.4 && < 0.5
|
||||
, resourcet >= 1.1.10 && < 1.2
|
||||
, resourcet >= 1.1.9 && < 1.3
|
||||
, tagged >= 0.8.5 && < 0.9
|
||||
, transformers-base >= 0.4.4 && < 0.5
|
||||
, transformers-compat >= 0.5.1 && < 0.6
|
||||
, transformers-compat >= 0.5.1 && < 0.7
|
||||
, wai >= 3.2.1.1 && < 3.3
|
||||
, wai-app-static >= 3.1.6.1 && < 3.2
|
||||
, warp >= 3.2.13 && < 3.3
|
||||
|
@ -164,22 +170,22 @@ test-suite spec
|
|||
-- Additonal dependencies
|
||||
build-depends:
|
||||
directory >= 1.2.1.0 && < 1.4
|
||||
, hspec >= 2.4.4 && < 2.5
|
||||
, hspec >= 2.4.4 && < 2.6
|
||||
, hspec-wai >= 0.9 && < 0.10
|
||||
, should-not-typecheck >= 2.1.0 && < 2.2
|
||||
, parsec >= 3.1.11 && < 3.2
|
||||
, QuickCheck >= 2.10.1 && < 2.12
|
||||
, wai-extra >= 3.0.21.0 && < 3.1
|
||||
, temporary >= 1.2.0.3 && < 1.3
|
||||
, temporary >= 1.2.0.3 && < 1.4
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.5
|
||||
hspec-discover:hspec-discover >=2.4.4 && <2.6
|
||||
|
||||
test-suite doctests
|
||||
build-depends:
|
||||
base
|
||||
, servant-server
|
||||
, doctest >= 0.13.0 && <0.14
|
||||
, doctest >= 0.13.0 && <0.16
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: test/doctests.hs
|
||||
buildable: True
|
||||
|
|
|
@ -44,8 +44,9 @@ import qualified Data.ByteString.Lazy as BL
|
|||
import Data.Maybe (fromMaybe, mapMaybe,
|
||||
isNothing, maybeToList)
|
||||
import Data.Either (partitionEithers)
|
||||
import Data.Semigroup ((<>))
|
||||
import Data.String (IsString (..))
|
||||
import Data.String.Conversions (cs, (<>))
|
||||
import Data.String.Conversions (cs)
|
||||
import Data.Tagged (Tagged(..), retag, untag)
|
||||
import qualified Data.Text as T
|
||||
import Data.Typeable
|
||||
|
@ -67,7 +68,7 @@ import Web.HttpApiData (FromHttpApiData, parseHeader,
|
|||
parseQueryParam,
|
||||
parseUrlPieceMaybe,
|
||||
parseUrlPieces)
|
||||
import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture,
|
||||
import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture',
|
||||
CaptureAll, Verb, EmptyAPI,
|
||||
ReflectMethod(reflectMethod),
|
||||
IsSecure(..), Header', QueryFlag,
|
||||
|
@ -164,9 +165,9 @@ instance (HasServer a context, HasServer b context) => HasServer (a :<|> b) cont
|
|||
-- > where getBook :: Text -> Handler Book
|
||||
-- > getBook isbn = ...
|
||||
instance (KnownSymbol capture, FromHttpApiData a, HasServer api context)
|
||||
=> HasServer (Capture capture a :> api) context where
|
||||
=> HasServer (Capture' mods capture a :> api) context where
|
||||
|
||||
type ServerT (Capture capture a :> api) m =
|
||||
type ServerT (Capture' mods capture a :> api) m =
|
||||
a -> ServerT api m
|
||||
|
||||
hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy :: Proxy api) pc nt . s
|
||||
|
@ -749,14 +750,14 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
|
|||
-- ...
|
||||
-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
|
||||
-- ...Maybe you haven't applied enough arguments to
|
||||
-- ...Capture "foo"
|
||||
-- ...Capture' '[] "foo"
|
||||
-- ...
|
||||
--
|
||||
-- >>> undefined :: Server (Capture "foo" :> Get '[JSON] Int)
|
||||
-- ...
|
||||
-- ...Expected something of kind Symbol or *, got: k -> l on the LHS of ':>'.
|
||||
-- ...Maybe you haven't applied enough arguments to
|
||||
-- ...Capture "foo"
|
||||
-- ...Capture' '[] "foo"
|
||||
-- ...
|
||||
--
|
||||
instance TypeError (HasServerArrowKindError arr) => HasServer ((arr :: k -> l) :> api) context
|
||||
|
@ -778,7 +779,7 @@ type HasServerArrowKindError arr =
|
|||
-- ...
|
||||
-- ...No instance HasServer (a -> b).
|
||||
-- ...Maybe you have used '->' instead of ':>' between
|
||||
-- ...Capture "foo" Int
|
||||
-- ...Capture' '[] "foo" Int
|
||||
-- ...and
|
||||
-- ...Verb 'GET 200 '[JSON] Int
|
||||
-- ...
|
||||
|
@ -787,7 +788,7 @@ type HasServerArrowKindError arr =
|
|||
-- ...
|
||||
-- ...No instance HasServer (a -> b).
|
||||
-- ...Maybe you have used '->' instead of ':>' between
|
||||
-- ...Capture "foo" Int
|
||||
-- ...Capture' '[] "foo" Int
|
||||
-- ...and
|
||||
-- ...Verb 'GET 200 '[JSON] Int
|
||||
-- ...
|
||||
|
|
|
@ -13,11 +13,11 @@ module Servant.Server.Internal.RoutingApplication where
|
|||
import Control.Monad (ap, liftM)
|
||||
import Control.Monad.Base (MonadBase (..))
|
||||
import Control.Monad.Catch (MonadThrow (..))
|
||||
import Control.Monad.Reader (MonadReader (..), ReaderT, runReaderT)
|
||||
import Control.Monad.Reader (MonadReader (..), ReaderT (..), runReaderT)
|
||||
import Control.Monad.Trans (MonadIO (..), MonadTrans (..))
|
||||
import Control.Monad.Trans.Control (ComposeSt, MonadBaseControl (..), MonadTransControl (..),
|
||||
defaultLiftBaseWith, defaultRestoreM)
|
||||
import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT)
|
||||
import Control.Monad.Trans.Resource (MonadResource (..), ResourceT, runResourceT, transResourceT, withInternalState, runInternalState)
|
||||
import Network.Wai (Application, Request, Response, ResponseReceived)
|
||||
import Prelude ()
|
||||
import Prelude.Compat
|
||||
|
@ -84,7 +84,6 @@ instance MonadTransControl RouteResultT where
|
|||
instance MonadThrow m => MonadThrow (RouteResultT m) where
|
||||
throwM = lift . throwM
|
||||
|
||||
|
||||
toApplication :: RoutingApplication -> Application
|
||||
toApplication ra request respond = ra request routingRespond
|
||||
where
|
||||
|
@ -194,18 +193,27 @@ newtype DelayedIO a = DelayedIO { runDelayedIO' :: ReaderT Request (ResourceT (R
|
|||
deriving
|
||||
( Functor, Applicative, Monad
|
||||
, MonadIO, MonadReader Request
|
||||
, MonadBase IO
|
||||
, MonadThrow
|
||||
, MonadResource
|
||||
)
|
||||
|
||||
instance MonadBase IO DelayedIO where
|
||||
liftBase = liftIO
|
||||
|
||||
liftRouteResult :: RouteResult a -> DelayedIO a
|
||||
liftRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
|
||||
|
||||
instance MonadBaseControl IO DelayedIO where
|
||||
type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
|
||||
liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
|
||||
restoreM = DelayedIO . restoreM
|
||||
-- type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
|
||||
-- liftBaseWith f = DelayedIO $ liftBaseWith $ \g -> f (g . runDelayedIO')
|
||||
-- restoreM = DelayedIO . restoreM
|
||||
|
||||
type StM DelayedIO a = RouteResult a
|
||||
liftBaseWith f = DelayedIO $ ReaderT $ \req -> withInternalState $ \s ->
|
||||
liftBaseWith $ \runInBase -> f $ \x ->
|
||||
runInBase (runInternalState (runReaderT (runDelayedIO' x) req) s)
|
||||
restoreM = DelayedIO . lift . withInternalState . const . restoreM
|
||||
|
||||
|
||||
runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a)
|
||||
runDelayedIO m req = transResourceT runRouteResultT $ runReaderT (runDelayedIO' m) req
|
||||
|
|
|
@ -1,5 +1,87 @@
|
|||
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
|
||||
|
||||
0.13.0.1
|
||||
--------
|
||||
|
||||
- Support `base-compat-0.10`
|
||||
|
||||
0.13
|
||||
----
|
||||
|
||||
### Significant changes
|
||||
|
||||
- Streaming endpoint support.
|
||||
([#836](https://github.com/haskell-servant/servant/pull/836))
|
||||
|
||||
```haskell
|
||||
type StreamApi f = "streamGetNewline" :> StreamGet NewlineFraming JSON (f Person)
|
||||
```
|
||||
|
||||
See tutorial for more details
|
||||
- [A web API as a type - StreamGet and StreamPost](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/ApiType.html#streamget-and-streampost)
|
||||
- [Serving an API - streaming endpoints](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Server.html#streaming-endpoints)
|
||||
- [Querying an API - Querying Streaming APIs](http://haskell-servant.readthedocs.io/en/release-0.13/tutorial/Client.html#querying-streaming-apis)
|
||||
|
||||
- *servant* Add `Servant.API.Modifiers`
|
||||
([#873](https://github.com/haskell-servant/servant/pull/873)
|
||||
[#903](https://github.com/haskell-servant/servant/pull/903))
|
||||
|
||||
`QueryParam`, `Header` and `ReqBody` understand modifiers:
|
||||
- `Required` or `Optional` (resulting in `a` or `Maybe a` in handlers)
|
||||
- `Strict` or `Lenient` (resulting in `a` or `Either String a` in handlers)
|
||||
|
||||
Also you can use `Description` as a modifier, but it doesn't yet work
|
||||
with `servant-docs`, only `servant-swagger`. [There is an issue.](https://github.com/haskell-servant/servant/issues/902)
|
||||
|
||||
- *servant-client* Support `http-client`’s `CookieJar`
|
||||
([#897](https://github.com/haskell-servant/servant/pull/897)
|
||||
[#883](https://github.com/haskell-servant/servant/pull/883))
|
||||
|
||||
`ClientM` preserves cookies between requests,
|
||||
if given initial `CookieJar`.
|
||||
To migrate from older code, change `ClientEnv` constructor
|
||||
to `mkClientEnv` which makes `ClientEnv` without `CookieJar`.
|
||||
|
||||
- *servant* Mono-kind-ise modifiers, resulting in better error messages.
|
||||
([#887](https://github.com/haskell-servant/servant/issues/887)
|
||||
[#890](https://github.com/haskell-servant/servant/pull/890))
|
||||
|
||||
- *servant* Add `TypeError ... => HasServer`s instances in GHC-8.2 for
|
||||
not saturated modifiers (`Capture "foo" :> ...`) or `->` in place of `:>`.
|
||||
([#893](https://github.com/haskell-servant/servant/pull/893))
|
||||
|
||||
- *Cookbook* example projects at
|
||||
http://haskell-servant.readthedocs.io/en/master/cookbook/index.html
|
||||
([#867](https://github.com/haskell-servant/servant/pull/867)
|
||||
[#892](https://github.com/haskell-servant/servant/pull/882))
|
||||
|
||||
- *Experimental work* `servant-client-ghcjs`
|
||||
([#818](https://github.com/haskell-servant/servant/pull/818)
|
||||
[#869](https://github.com/haskell-servant/servant/pull/869))
|
||||
|
||||
### Other changes
|
||||
|
||||
- *servant* Links aren't double escaped
|
||||
([#878](https://github.com/haskell-servant/servant/pull/878))
|
||||
|
||||
- Dependency updates
|
||||
([#900](https://github.com/haskell-servant/servant/pull/900)
|
||||
[#898](https://github.com/haskell-servant/servant/pull/898)
|
||||
[#895](https://github.com/haskell-servant/servant/pull/895)
|
||||
[#872](https://github.com/haskell-servant/servant/pull/872))
|
||||
|
||||
- Documentation updates
|
||||
([#875](https://github.com/haskell-servant/servant/pull/875)
|
||||
[#861](https://github.com/haskell-servant/servant/pull/861))
|
||||
|
||||
- Refactorings
|
||||
([#899](https://github.com/haskell-servant/servant/pull/899)
|
||||
[#896](https://github.com/haskell-servant/servant/pull/896)
|
||||
[#889](https://github.com/haskell-servant/servant/pull/889)
|
||||
[#891](https://github.com/haskell-servant/servant/pull/891)
|
||||
[#892](https://github.com/haskell-servant/servant/pull/892)
|
||||
[#885](https://github.com/haskell-servant/servant/pull/885))
|
||||
|
||||
0.12.1
|
||||
------
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
name: servant
|
||||
version: 0.12
|
||||
version: 0.13.0.1
|
||||
x-revision: 1
|
||||
synopsis: A family of combinators for defining webservices APIs
|
||||
description:
|
||||
A family of combinators for defining webservices APIs and serving them
|
||||
|
@ -18,10 +19,11 @@ category: Servant, Web
|
|||
build-type: Custom
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.2
|
||||
GHC==7.8.4,
|
||||
GHC==7.10.3,
|
||||
GHC==8.0.2,
|
||||
GHC==8.2.2,
|
||||
GHC==8.4.1
|
||||
extra-source-files:
|
||||
include/*.h
|
||||
CHANGELOG.md
|
||||
|
@ -69,7 +71,7 @@ library
|
|||
--
|
||||
-- note: mtl lower bound is so low because of GHC-7.8
|
||||
build-depends:
|
||||
base >= 4.7 && < 4.11
|
||||
base >= 4.7 && < 4.12
|
||||
, bytestring >= 0.10.4.0 && < 0.11
|
||||
, mtl >= 2.1 && < 2.3
|
||||
, text >= 1.2.3.0 && < 1.3
|
||||
|
@ -80,13 +82,13 @@ library
|
|||
|
||||
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
||||
-- Here can be exceptions if we really need features from the newer versions.
|
||||
build-depends:
|
||||
base-compat >= 0.9.3 && < 0.10
|
||||
, aeson >= 1.2.3.0 && < 1.3
|
||||
build-depends:
|
||||
base-compat >= 0.9.3 && < 0.11
|
||||
, aeson >= 1.2.3.0 && < 1.5
|
||||
, attoparsec >= 0.13.2.0 && < 0.14
|
||||
, case-insensitive >= 1.2.0.10 && < 1.3
|
||||
, http-api-data >= 0.3.7.1 && < 0.4
|
||||
, http-media >= 0.7.1.1 && < 0.8
|
||||
, http-media >= 0.7.0 && < 0.8
|
||||
, http-types >= 0.12 && < 0.13
|
||||
, natural-transformation >= 0.4 && < 0.5
|
||||
, mmorph >= 1.1.0 && < 1.2
|
||||
|
@ -153,22 +155,22 @@ test-suite spec
|
|||
-- Additonal dependencies
|
||||
build-depends:
|
||||
aeson-compat >= 0.3.3 && < 0.4
|
||||
, hspec >= 2.4.4 && < 2.5
|
||||
, hspec >= 2.4.4 && < 2.6
|
||||
, QuickCheck >= 2.10.1 && < 2.12
|
||||
, quickcheck-instances >= 0.3.16 && < 0.4
|
||||
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover >= 2.4.4 && < 2.5
|
||||
hspec-discover:hspec-discover >= 2.4.4 && < 2.6
|
||||
|
||||
test-suite doctests
|
||||
build-depends:
|
||||
base
|
||||
, servant
|
||||
, doctest >= 0.13.0 && <0.14
|
||||
, doctest >= 0.13.0 && <0.16
|
||||
|
||||
-- We test Links failure with doctest, so we need extra dependencies
|
||||
build-depends:
|
||||
hspec >= 2.4.4 && < 2.5
|
||||
hspec >= 2.4.4 && < 2.6
|
||||
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: test/doctests.hs
|
||||
|
|
|
@ -74,7 +74,7 @@ module Servant.API (
|
|||
|
||||
import Servant.API.Alternative ((:<|>) (..))
|
||||
import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
|
||||
import Servant.API.Capture (Capture, CaptureAll)
|
||||
import Servant.API.Capture (Capture, Capture', CaptureAll)
|
||||
import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
|
||||
JSON,
|
||||
MimeRender (..), NoContent (NoContent),
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE PolyKinds #-}
|
||||
{-# OPTIONS_HADDOCK not-home #-}
|
||||
module Servant.API.Capture (Capture, CaptureAll) where
|
||||
module Servant.API.Capture (Capture, Capture', CaptureAll) where
|
||||
|
||||
import Data.Typeable (Typeable)
|
||||
import GHC.TypeLits (Symbol)
|
||||
|
@ -12,9 +12,11 @@ import GHC.TypeLits (Symbol)
|
|||
--
|
||||
-- >>> -- GET /books/:isbn
|
||||
-- >>> type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book
|
||||
data Capture (sym :: Symbol) (a :: *)
|
||||
deriving (Typeable)
|
||||
type Capture = Capture' '[] -- todo
|
||||
|
||||
-- | 'Capture' which can be modified. For example with 'Description'.
|
||||
data Capture' (mods :: [*]) (sym :: Symbol) (a :: *)
|
||||
deriving (Typeable)
|
||||
|
||||
-- | Capture all remaining values from the request path under a certain type
|
||||
-- @a@.
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE PolyKinds #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE PolyKinds #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# OPTIONS_HADDOCK not-home #-}
|
||||
module Servant.API.Description (Description, Summary) where
|
||||
module Servant.API.Description (
|
||||
-- * Combinators
|
||||
Description,
|
||||
Summary,
|
||||
-- * Used as modifiers
|
||||
FoldDescription,
|
||||
FoldDescription',
|
||||
reflectDescription,
|
||||
) where
|
||||
|
||||
import Data.Typeable (Typeable)
|
||||
import GHC.TypeLits (Symbol)
|
||||
import GHC.TypeLits (Symbol, KnownSymbol, symbolVal)
|
||||
import Data.Proxy (Proxy (..))
|
||||
|
||||
-- | Add a short summary for (part of) API.
|
||||
--
|
||||
-- Example:
|
||||
|
@ -29,6 +43,32 @@ data Summary (sym :: Symbol)
|
|||
data Description (sym :: Symbol)
|
||||
deriving (Typeable)
|
||||
|
||||
-- | Fold modifier list to decide whether argument should be parsed strictly or leniently.
|
||||
--
|
||||
-- >>> :kind! FoldDescription '[]
|
||||
-- FoldDescription '[] :: Symbol
|
||||
-- = ""
|
||||
--
|
||||
-- >>> :kind! FoldDescription '[Required, Description "foobar", Lenient]
|
||||
-- FoldDescription '[Required, Description "foobar", Lenient] :: Symbol
|
||||
-- = "foobar"
|
||||
--
|
||||
type FoldDescription mods = FoldDescription' "" mods
|
||||
|
||||
-- | Implementation of 'FoldDescription'.
|
||||
type family FoldDescription' (acc :: Symbol) (mods :: [*]) :: Symbol where
|
||||
FoldDescription' acc '[] = acc
|
||||
FoldDescription' acc (Description desc ': mods) = FoldDescription' desc mods
|
||||
FoldDescription' acc (mod ': mods) = FoldDescription' acc mods
|
||||
|
||||
-- | Reflect description to the term level.
|
||||
--
|
||||
-- >>> reflectDescription (Proxy :: Proxy '[Required, Description "foobar", Lenient])
|
||||
-- "foobar"
|
||||
--
|
||||
reflectDescription :: forall mods. KnownSymbol (FoldDescription mods) => Proxy mods -> String
|
||||
reflectDescription _ = symbolVal (Proxy :: Proxy (FoldDescription mods))
|
||||
|
||||
-- $setup
|
||||
-- >>> import Servant.API
|
||||
-- >>> import Data.Aeson
|
||||
|
|
|
@ -22,7 +22,7 @@ comprehensiveAPI = Proxy
|
|||
type ComprehensiveAPIWithoutRaw =
|
||||
GET :<|>
|
||||
Get '[JSON] Int :<|>
|
||||
Capture "foo" Int :> GET :<|>
|
||||
Capture' '[Description "example description"] "foo" Int :> GET :<|>
|
||||
Header "foo" Int :> GET :<|>
|
||||
Header' '[Required, Lenient] "bar" Int :> GET :<|>
|
||||
HttpVersion :> GET :<|>
|
||||
|
|
|
@ -101,7 +101,7 @@ module Servant.Utils.Links (
|
|||
) where
|
||||
|
||||
import Data.List
|
||||
import Data.Monoid.Compat ( (<>) )
|
||||
import Data.Semigroup ((<>))
|
||||
import Data.Proxy ( Proxy(..) )
|
||||
import Data.Singletons.Bool ( SBool (..), SBoolI (..) )
|
||||
import qualified Data.Text as Text
|
||||
|
@ -115,7 +115,7 @@ import Prelude.Compat
|
|||
import Web.HttpApiData
|
||||
import Servant.API.Alternative ( (:<|>)((:<|>)) )
|
||||
import Servant.API.BasicAuth ( BasicAuth )
|
||||
import Servant.API.Capture ( Capture, CaptureAll )
|
||||
import Servant.API.Capture ( Capture', CaptureAll )
|
||||
import Servant.API.ReqBody ( ReqBody' )
|
||||
import Servant.API.QueryParam ( QueryParam', QueryParams, QueryFlag )
|
||||
import Servant.API.Header ( Header' )
|
||||
|
@ -336,8 +336,8 @@ instance HasLink sub => HasLink (ReqBody' mods ct a :> sub) where
|
|||
toLink _ = toLink (Proxy :: Proxy sub)
|
||||
|
||||
instance (ToHttpApiData v, HasLink sub)
|
||||
=> HasLink (Capture sym v :> sub) where
|
||||
type MkLink (Capture sym v :> sub) = v -> MkLink sub
|
||||
=> HasLink (Capture' mods sym v :> sub) where
|
||||
type MkLink (Capture' mods sym v :> sub) = v -> MkLink sub
|
||||
toLink _ l v =
|
||||
toLink (Proxy :: Proxy sub) $
|
||||
addSegment (escaped . Text.unpack $ toUrlPiece v) l
|
||||
|
|
Loading…
Reference in New Issue