Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- type Responder a = Request -> Response ByteString -> a
- data JsonResult a
- = ParseError Text
- | DecodeError Text
- | JsonSuccess a
- parseBody :: FromJSON a => ByteString -> JsonResult a
- parseBodyWith :: FromJSON a => ByteString -> (Text -> b) -> (Text -> b) -> (a -> b) -> b
- basicResponder :: (Int -> ByteString -> a) -> Responder a
Documentation
data JsonResult a Source #
Wrap up json parse and decode errors.
Instances
parseBody :: FromJSON a => ByteString -> JsonResult a Source #
Parse and decode body.
parseBodyWith :: FromJSON a => ByteString -> (Text -> b) -> (Text -> b) -> (a -> b) -> b Source #
Parse and decode body handling error cases and success case.
basicResponder :: (Int -> ByteString -> a) -> Responder a Source #
Lift function handling status code and body into a responder.