| Copyright | Dennis Gosnell 2017 |
|---|---|
| License | BSD3 |
| Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Servant.Checked.Exceptions.Internal.Servant.API
- data Throws (e :: *)
- data NoThrow
- data Throwing (e :: [*])
- type family ThrowingNonterminal api where ...
- class ErrStatus e where
- type family AllErrStatus (es :: [k]) :: Constraint where ...
Documentation
NoThrow is used to indicate that an API will not throw an error, but
that it will still return a response wrapped in a
Envelope.
Examples
Create an API using NoThrow:
>>>import Servant.API (Get, JSON, (:>))>>>type API = NoThrow :> Get '[JSON] Int
A servant-server handler for this type would look like the following:
apiHandler ::Handler(Envelope'[] Int) apiHandler =pureSuccEnvelope3
type family ThrowingNonterminal api where ... Source #
class ErrStatus e where Source #
Minimal complete definition
Methods
toErrStatus :: e -> Status Source #
type family AllErrStatus (es :: [k]) :: Constraint where ... Source #
Equations
| AllErrStatus '[] = () | |
| AllErrStatus (a ': as) = (ErrStatus a, AllErrStatus as) |
>>>:set -XDataKinds>>>:set -XTypeOperators