summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphadej <>2019-02-27 16:15:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-02-27 16:15:00 (GMT)
commit479fdcef04c0e8d74c50d19babeb26af332cd213 (patch)
tree28d457ad94be8b09c615de8c92f1b0dd9521a1f7
parentb34e10e7e43e2d977b50050b2e2254cc73261b26 (diff)
version 0.160.16
-rwxr-xr-xCHANGELOG.md74
-rw-r--r--servant.cabal13
-rw-r--r--src/Servant/API/ContentTypes.hs4
-rw-r--r--src/Servant/API/ResponseHeaders.hs18
4 files changed, 101 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0932031..727a7cd 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,75 @@
[The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md)
+0.16
+----
+
+### Significant changes
+
+- Rename `ServantError` to `ClientError`, `ServantErr` to `ServerError`
+ [#1131](https://github.com/haskell-servant/servant/pull/1131)
+- *servant-client-core* Rearrange modules. No more `Internal` modules, whole
+ API is versioned.
+ [#1130](https://github.com/haskell-servant/servant/pull/1130)
+- *servant-http-streams* New package
+ [#1117](https://github.com/haskell-servant/servant/pull/1117)
+- *servant-client-core* `RequestBody` is now
+
+ ```haskell
+ = RequestBodyLBS LBS.ByteString
+ | RequestBodyBS BS.ByteString
+ | RequestBodySource (SourceIO LBS.ByteString)
+ ```
+
+ i.e. no more replicates `http-client`s API.
+ [#1117](https://github.com/haskell-servant/servant/pull/1117)
+
+- *servant-client-core* Keep structured exceptions in `ConnectionError`
+ constructor of `ClientError`
+ [#1115](https://github.com/haskell-servant/servant/pull/1115)
+
+ ```diff
+ -| ConnectionError Text
+ +| ConnectionError SomeException
+ ```
+
+- *servant-client-core* Preserve failing request in `FailureResponse`
+ constructor of `ClientError`
+ [#1114](https://github.com/haskell-servant/servant/pull/1114)
+
+ ```diff
+ -FailureResponse Response
+ +-- | The server returned an error response including the
+ +-- failing request. 'requestPath' includes the 'BaseUrl' and the
+ +-- path of the request.
+ +FailureResponse (RequestF () (BaseUrl, BS.ByteString)) Response
+ ```
+
+- *servant-client* Fix (implement) `StreamBody` instance
+ [#1110](https://github.com/haskell-servant/servant/pull/1110)
+
+### Other changes
+
+- *servant-client* Update CookieJar with intermediate request/responses (redirects)
+ [#1104](https://github.com/haskell-servant/servant/pull/1104)
+- *servant-server* Reorder HTTP failure code priorities
+ [#1103](https://github.com/haskell-servant/servant/pull/1103)
+- *servant-server* Re-organise internal modules
+ [#1139](https://github.com/haskell-servant/servant/pull/1139)
+- Allow `network-3.0`
+ [#1107](https://github.com/haskell-servant/servant/pull/1107)
+- Add `NFData NoContent` instance
+ [#1090](https://github.com/haskell-servant/servant/pull/1090)
+
+- Documentation updates
+ [#1127](https://github.com/haskell-servant/servant/pull/1127)
+ [#1124](https://github.com/haskell-servant/servant/pull/1124)
+ [#1098](https://github.com/haskell-servant/servant/pull/1098)
+
+- CI updates
+ [#1123](https://github.com/haskell-servant/servant/pull/1123)
+ [#1121](https://github.com/haskell-servant/servant/pull/1121)
+ [#1119](https://github.com/haskell-servant/servant/pull/1119)
+
0.15
----
@@ -177,7 +247,7 @@
0.14
----
-### Signifacant changes
+### Significant changes
- `Stream` takes a status code argument
@@ -292,7 +362,7 @@
### Note
-(VIM) Regular-expression to link PR numbers: `s/\v#(\d+)/[#\1](https:\/\/github.com\/haskell-servant\/servant/pull\/\1)/`
+(VIM) Regular-expression to link PR numbers: `s/\v#(\d+)/[#\1](https:\/\/github.com\/haskell-servant\/servant\/pull\/\1)/`
0.13.0.1
--------
diff --git a/servant.cabal b/servant.cabal
index 2a8fb84..eb4257c 100644
--- a/servant.cabal
+++ b/servant.cabal
@@ -1,6 +1,6 @@
cabal-version: >=1.10
name: servant
-version: 0.15
+version: 0.16
synopsis: A family of combinators for defining webservices APIs
category: Servant, Web
@@ -17,14 +17,14 @@ license: BSD3
license-file: LICENSE
author: Servant Contributors
maintainer: haskell-servant-maintainers@googlegroups.com
-copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2018 Servant Contributors
+copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors
build-type: Custom
tested-with:
GHC ==8.0.2
|| ==8.2.2
|| ==8.4.4
- || ==8.6.2
+ || ==8.6.3
extra-source-files:
CHANGELOG.md
@@ -109,6 +109,7 @@ library
, attoparsec >= 0.13.2.2 && < 0.14
, bifunctors >= 5.5.3 && < 5.6
, case-insensitive >= 1.2.0.11 && < 1.3
+ , deepseq >= 1.4.2.0 && < 1.5
, http-media >= 0.7.1.3 && < 0.8
, http-types >= 0.12.2 && < 0.13
, mmorph >= 1.1.2 && < 1.2
@@ -168,12 +169,12 @@ test-suite spec
-- Additonal dependencies
build-depends:
- hspec >= 2.6.0 && < 2.7
+ hspec >= 2.6.0 && < 2.8
, QuickCheck >= 2.12.6.1 && < 2.13
, quickcheck-instances >= 0.3.19 && < 0.4
build-tool-depends:
- hspec-discover:hspec-discover >= 2.6.0 && < 2.7
+ hspec-discover:hspec-discover >= 2.6.0 && < 2.8
test-suite doctests
build-depends:
@@ -183,7 +184,7 @@ test-suite doctests
-- We test Links failure with doctest, so we need extra dependencies
build-depends:
- hspec >= 2.6.0 && < 2.7
+ hspec >= 2.6.0 && < 2.8
type: exitcode-stdio-1.0
main-is: test/doctests.hs
diff --git a/src/Servant/API/ContentTypes.hs b/src/Servant/API/ContentTypes.hs
index 5df6063..145ecfb 100644
--- a/src/Servant/API/ContentTypes.hs
+++ b/src/Servant/API/ContentTypes.hs
@@ -71,6 +71,8 @@ module Servant.API.ContentTypes
import Control.Arrow
(left)
import Control.Monad.Compat
+import Control.DeepSeq
+ (NFData)
import Data.Aeson
(FromJSON (..), ToJSON (..), encode)
import Data.Aeson.Parser
@@ -361,6 +363,8 @@ instance MimeRender OctetStream BS.ByteString where
data NoContent = NoContent
deriving (Show, Eq, Read, Generic)
+instance NFData NoContent
+
--------------------------------------------------------------------------
-- * MimeUnrender Instances
diff --git a/src/Servant/API/ResponseHeaders.hs b/src/Servant/API/ResponseHeaders.hs
index e5ff1ed..6ca42b6 100644
--- a/src/Servant/API/ResponseHeaders.hs
+++ b/src/Servant/API/ResponseHeaders.hs
@@ -35,6 +35,8 @@ module Servant.API.ResponseHeaders
, HList(..)
) where
+import Control.DeepSeq
+ (NFData (..))
import Data.ByteString.Char8 as BS
(ByteString, init, pack, unlines)
import qualified Data.CaseInsensitive as CI
@@ -60,16 +62,32 @@ data Headers ls a = Headers { getResponse :: a
-- ^ HList of headers.
} deriving (Functor)
+instance (NFDataHList ls, NFData a) => NFData (Headers ls a) where
+ rnf (Headers x hdrs) = rnf x `seq` rnf hdrs
+
data ResponseHeader (sym :: Symbol) a
= Header a
| MissingHeader
| UndecodableHeader ByteString
deriving (Typeable, Eq, Show, Functor)
+instance NFData a => NFData (ResponseHeader sym a) where
+ rnf MissingHeader = ()
+ rnf (UndecodableHeader bs) = rnf bs
+ rnf (Header x) = rnf x
+
data HList a where
HNil :: HList '[]
HCons :: ResponseHeader h x -> HList xs -> HList (Header h x ': xs)
+class NFDataHList xs where rnfHList :: HList xs -> ()
+instance NFDataHList '[] where rnfHList HNil = ()
+instance (y ~ Header h x, NFData x, NFDataHList xs) => NFDataHList (y ': xs) where
+ rnfHList (HCons h xs) = rnf h `seq` rnfHList xs
+
+instance NFDataHList xs => NFData (HList xs) where
+ rnf = rnfHList
+
type family HeaderValMap (f :: * -> *) (xs :: [*]) where
HeaderValMap f '[] = '[]
HeaderValMap f (Header h x ': xs) = Header h (f x) ': HeaderValMap f xs