-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Declarative DSL for parsing an HTTP response
--
-- Declarative DSL for parsing an HTTP response
@package http-response-decoder
@version 0.2.2
-- | A DSL of HTTP-response decoders.
module HTTPResponseDecoder
run :: Response a -> Response BodyReader -> IO (Either Text a)
-- | Response decoder.
data Response a
-- | Composes a Response decoder from Head and Body decoders.
--
-- You can then merge the tuple in the result using the Functor
-- interface.
headAndBody :: Head a -> Body b -> Response (a, b)
-- | Response head decoder.
--
-- Supports the Applicative and Alternative interfaces.
data Head a
statusCode :: Matcher Int a -> Head a
httpVersion :: Matcher (Int, Int) a -> Head a
headers :: Headers a -> Head a
-- | Response headers decoder.
data Headers a
header :: ByteString -> Matcher ByteString a -> Headers a
contentType :: Matcher ByteString a -> Headers a
-- | Body decoder.
data Body a
bodyStream :: (IO ByteString -> IO (Either Text a)) -> Body a
bodyBytes :: Matcher ByteString a -> Body a
bodyLazyBytes :: Matcher ByteString a -> Body a
-- | A composable abstraction for checking or converting a context value.
data Matcher a b :: * -> * -> *
-- | Tests the matched value on equality with the provided value.
equals :: Eq a => a -> Matcher a ()
-- | Checks whether the matched value satisfies the provided predicate.
satisfies :: (a -> Bool) -> Matcher a ()
-- | Tries to convert the matched value to an output value, with
-- Either encoding the success or failure of the conversion.
converts :: (a -> Either Text b) -> Matcher a b
instance GHC.Base.Functor HTTPResponseDecoder.Body
instance GHC.Base.Alternative HTTPResponseDecoder.Headers
instance GHC.Base.Applicative HTTPResponseDecoder.Headers
instance GHC.Base.Functor HTTPResponseDecoder.Headers
instance GHC.Base.Functor HTTPResponseDecoder.Head
instance GHC.Base.Functor HTTPResponseDecoder.Response
instance GHC.Base.Applicative HTTPResponseDecoder.Head
instance GHC.Base.Alternative HTTPResponseDecoder.Head