servant 0.15 → 0.16
raw patch · 4 files changed
+101/−8 lines, 4 filesdep +deepseqdep ~QuickCheckdep ~hspec
Dependencies added: deepseq
Dependency ranges changed: QuickCheck, hspec
Files
- CHANGELOG.md +72/−2
- servant.cabal +7/−6
- src/Servant/API/ContentTypes.hs +4/−0
- src/Servant/API/ResponseHeaders.hs +18/−0
CHANGELOG.md view
@@ -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 --------
servant.cabal view
@@ -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-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 @@ , 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 @@ -- 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 @@ -- 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
src/Servant/API/ContentTypes.hs view
@@ -71,6 +71,8 @@ import Control.Arrow (left) import Control.Monad.Compat+import Control.DeepSeq+ (NFData) import Data.Aeson (FromJSON (..), ToJSON (..), encode) import Data.Aeson.Parser@@ -360,6 +362,8 @@ -- | A type for responses without content-body. data NoContent = NoContent deriving (Show, Eq, Read, Generic)++instance NFData NoContent --------------------------------------------------------------------------
src/Servant/API/ResponseHeaders.hs view
@@ -35,6 +35,8 @@ , HList(..) ) where +import Control.DeepSeq+ (NFData (..)) import Data.ByteString.Char8 as BS (ByteString, init, pack, unlines) import qualified Data.CaseInsensitive as CI@@ -60,15 +62,31 @@ -- ^ 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 '[] = '[]