{-# options_haddock prune #-}
module Polysemy.Http.Effect.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
Response :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
Request :: Request -> Http c m (Either HttpError (Response LByteString))
Stream :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
ConsumeChunk :: c -> Http c m (Either HttpError ByteString)
makeSem_ ''Http
response ::
∀ c r a .
Member (Http c) r =>
Request ->
(Response c -> Sem r a) ->
Sem r (Either HttpError a)
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 a) ->
Sem r (Either HttpError a)
consumeChunk ::
∀ c r .
Member (Http c) r =>
c ->
Sem r (Either HttpError ByteString)