influxdb-haskell icon indicating copy to clipboard operation
influxdb-haskell copied to clipboard

Can queryChunked live in MonadIO rather than in IO?

Open dcolle opened this issue 3 years ago • 1 comments

https://github.com/maoe/influxdb-haskell/blob/4b84a55bc71a19a97ce339613c27249fc1aa2b0f/src/Database/InfluxDB/Query.hs#L475-L476

add a MonadIO m constraint and have the FoldM use this m rather than IO, and have the function return m r.

Background: I want to use this function to create a conduit source... thus in my case m would be something like ConduitT () a IO

dcolle avatar May 01 '22 23:05 dcolle

I don't think you can turn IO in a negative position to just MonadIO m. You'd need monad-control, monad-unlift, or something like that. Also FoldM consumes the responses rather than producing them. If you want a conduit source, you'll likely use withQueryResponse instead.

What type signature will your conduit source have?

maoe avatar May 02 '22 00:05 maoe