Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a HasResponse
class that Interprets
Verb
content into a particular api endpoint query result.
For instance Verb GET '[]
gets interpreted as an empty response of type Unit i.e ()
Synopsis
- class MonadError ClientError m => HasResponse (a :: k) m where
- type HttpOutput a :: Type
- httpRes :: sing a -> Response -> m (HttpOutput a)
- decodeAsBody :: forall ctyp a m sing. (MonadError ClientError m, MediaDecode ctyp a) => sing ctyp -> Response -> m a
- decodeAsHlist :: (MonadError ClientError m, HttpResConstraints rs) => Sing rs -> Response -> m (Hlist (HttpRes rs))
Documentation
class MonadError ClientError m => HasResponse (a :: k) m where Source #
type HttpOutput a :: Type Source #
httpRes :: sing a -> Response -> m (HttpOutput a) Source #
Instances
decodeAsBody :: forall ctyp a m sing. (MonadError ClientError m, MediaDecode ctyp a) => sing ctyp -> Response -> m a Source #
decodeAsHlist :: (MonadError ClientError m, HttpResConstraints rs) => Sing rs -> Response -> m (Hlist (HttpRes rs)) Source #
Turn a Response into a Hlist
of outputs