module Polysemy.Http.Data.Http where
import Polysemy (makeSem_)
import Polysemy.Http.Data.HttpError (HttpError)
import Polysemy.Http.Data.Request (Request)
import Polysemy.Http.Data.Response (Response)
data Http c :: Effect where
Request :: Request -> Http c m (Either HttpError (Response LByteString))
Stream :: Request -> (Response c -> m (Either HttpError a)) -> Http c m (Either HttpError a)
ConsumeChunk :: c -> Http c m (Either HttpError ByteString)
makeSem_ ''Http
request ::
∀ c r .
Member (Http c) r =>
Request ->
Sem r (Either HttpError (Response LByteString))
stream ::
∀ c r a .
Member (Http c) r =>
Request ->
(Response c -> Sem r (Either HttpError a)) ->
Sem r (Either HttpError a)
consumeChunk ::
∀ c r .
Member (Http c) r =>
c ->
Sem r (Either HttpError ByteString)