servant-server 0.19 → 0.19.1
raw patch · 4 files changed
+19/−8 lines, 4 filesdep ~basedep ~base-compatdep ~hspec
Dependency ranges changed: base, base-compat, hspec, http-api-data, servant, wai
Files
- CHANGELOG.md +6/−0
- servant-server.cabal +4/−4
- src/Servant/Server/Internal.hs +2/−2
- src/Servant/Server/Internal/Handler.hs +7/−2
CHANGELOG.md view
@@ -3,6 +3,12 @@ Package versions follow the [Package Versioning Policy](https://pvp.haskell.org/): in A.B.C, bumps to either A or B represent major versions. +0.19.1+------++- Add `MonadFail` instance for `Handler` wrt [#1545](https://github.com/haskell-servant/servant/issues/1545)+- Support GHC 9.2 [#1525](https://github.com/haskell-servant/servant/issues/1525)+ 0.19 ----
servant-server.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: servant-server-version: 0.19+version: 0.19.1 synopsis: A family of combinators for defining webservices APIs and serving them category: Servant, Web@@ -60,12 +60,12 @@ -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends:- base >= 4.9 && < 4.16+ base >= 4.9 && < 4.17 , bytestring >= 0.10.8.1 && < 0.12 , constraints >= 0.2 && < 0.14 , containers >= 0.5.7.1 && < 0.7 , mtl >= 2.2.2 && < 2.3- , text >= 1.2.3.0 && < 1.3+ , text >= 1.2.3.0 && < 2.1 , transformers >= 0.5.2.0 && < 0.6 , filepath >= 1.4.1.1 && < 1.5 @@ -78,7 +78,7 @@ -- 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.10.5 && < 0.12+ base-compat >= 0.10.5 && < 0.13 , base64-bytestring >= 1.0.0.1 && < 1.3 , exceptions >= 0.10.0 && < 0.11 , http-media >= 0.7.1.3 && < 0.9
src/Servant/Server/Internal.hs view
@@ -41,7 +41,7 @@ import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC8 import qualified Data.ByteString.Lazy as BL-import Data.Constraint (Dict(..))+import Data.Constraint (Constraint, Dict(..)) import Data.Either (partitionEithers) import Data.Maybe@@ -821,7 +821,7 @@ -- Erroring instance for 'HasServer' when a combinator is not fully applied instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context where- type ServerT (arr :> sub) _ = TypeError (PartialApplication HasServer arr)+ type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr) route = error "unreachable" hoistServerWithContext _ _ _ _ = error "unreachable"
src/Servant/Server/Internal/Handler.hs view
@@ -13,17 +13,19 @@ import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Monad.Error.Class- (MonadError)+ (MonadError, throwError) import Control.Monad.IO.Class (MonadIO) import Control.Monad.Trans.Control (MonadBaseControl (..)) import Control.Monad.Trans.Except (ExceptT, runExceptT)+import Data.String+ (fromString) import GHC.Generics (Generic) import Servant.Server.Internal.ServerError- (ServerError)+ (ServerError, errBody, err500) newtype Handler a = Handler { runHandler' :: ExceptT ServerError IO a } deriving@@ -31,6 +33,9 @@ , MonadError ServerError , MonadThrow, MonadCatch, MonadMask )++instance MonadFail Handler where+ fail str = throwError err500 { errBody = fromString str } instance MonadBase IO Handler where liftBase = Handler . liftBase