hreq-conduit-0.1.0.0: Conduit streaming support for Hreq.

Safe HaskellNone
LanguageHaskell2010

Hreq.Conduit.Internal.HTTP

Contents

Description

This module provides functionality for running the Hreq monad as a Streaming HTTP client and necessary class instances.

Synopsis

Documentation

newtype Hreq m a Source #

Constructors

Hreq 

Fields

Instances
MonadTrans Hreq Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

lift :: Monad m => m a -> Hreq m a #

Monad m => MonadReader HttpConfig (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

ask :: Hreq m HttpConfig #

local :: (HttpConfig -> HttpConfig) -> Hreq m a -> Hreq m a #

reader :: (HttpConfig -> a) -> Hreq m a #

Monad m => Monad (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

(>>=) :: Hreq m a -> (a -> Hreq m b) -> Hreq m b #

(>>) :: Hreq m a -> Hreq m b -> Hreq m b #

return :: a -> Hreq m a #

fail :: String -> Hreq m a #

Functor m => Functor (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

fmap :: (a -> b) -> Hreq m a -> Hreq m b #

(<$) :: a -> Hreq m b -> Hreq m a #

Applicative m => Applicative (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

pure :: a -> Hreq m a #

(<*>) :: Hreq m (a -> b) -> Hreq m a -> Hreq m b #

liftA2 :: (a -> b -> c) -> Hreq m a -> Hreq m b -> Hreq m c #

(*>) :: Hreq m a -> Hreq m b -> Hreq m b #

(<*) :: Hreq m a -> Hreq m b -> Hreq m a #

MonadIO m => MonadIO (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

liftIO :: IO a -> Hreq m a #

MonadUnliftIO m => MonadUnliftIO (Hreq m) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

askUnliftIO :: Hreq m (UnliftIO (Hreq m)) #

withRunInIO :: ((forall a. Hreq m a -> IO a) -> IO b) -> Hreq m b #

RunClient (Hreq IO) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

runClient :: Request -> Hreq IO Response

throwHttpError :: ClientError -> Hreq IO a

checkResponse :: Request -> Response -> Hreq IO (Maybe ClientError)

RunStreamingClient (Hreq IO) ResBodyStream Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

withStreamingClient :: Request -> (ResBodyStream -> IO r) -> Hreq IO r

newtype ResBodyStream Source #

Constructors

ResBodyStream StreamConduit 
Instances
RunStreamingClient (Hreq IO) ResBodyStream Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

withStreamingClient :: Request -> (ResBodyStream -> IO r) -> Hreq IO r

type RunConduitClient m = RunStreamingClient m ResBodyStream Source #

class Monad m => RunClient (m :: Type -> Type) #

Minimal complete definition

runClient, throwHttpError, checkResponse

Instances
RunClient (Hreq IO) 
Instance details

Defined in Hreq.Client.Internal.HTTP

Methods

runClient :: Request -> Hreq IO Response

throwHttpError :: ClientError -> Hreq IO a

checkResponse :: Request -> Response -> Hreq IO (Maybe ClientError)

RunClient (Hreq IO) Source # 
Instance details

Defined in Hreq.Conduit.Internal.HTTP

Methods

runClient :: Request -> Hreq IO Response

throwHttpError :: ClientError -> Hreq IO a

checkResponse :: Request -> Response -> Hreq IO (Maybe ClientError)

Run Hreq client

runHreq :: MonadIO m => BaseUrl -> Hreq m a -> m a Source #

Create Streaming Hreq Client

hreqWithConduit :: forall api ts v m. HasStreamingClient api ResBodyStream ts v m => HttpInput ts -> (StreamConduit -> IO ()) -> m () Source #

Streaming HTTP response with Conduit.

The required constraints are represented by the HasStreamingClient constraint.