Looks pretty straightforward to me The only other suggestion I'd provide is to also provide a `Managed` version of the same `Producer`, with this type:
query :: (Default QueryRunner columns haskells, MonadIO m, MonadMask m) => Connection -> Query columns -> Managed (Producer haskells m ()) Also, since it doesn't use the return value, you could even use the simpler `ListT` type instead: query :: (Default QueryRunner columns haskells, MonadIO m, MonadMask m) => Connection -> Query columns -> Managed (ListT m haskells) ... and then you can always convert that back to a `Producer` using `enumerate` if necessary > On Jul 29, 2017, at 2:54 PM, Bas van Dijk <v.dijk....@gmail.com> wrote: > > Hello, > > I just started playing with pipes and I really like it so far. For my first > project I would like to create a Producer for opaleye query results. I came > up with the following: > > > https://github.com/basvandijk/pipes-opaleye/blob/master/src/Pipes/Opaleye/RunQuery.hs > > <https://github.com/basvandijk/pipes-opaleye/blob/master/src/Pipes/Opaleye/RunQuery.hs> > > Is that the correct way of doing it? What can be improved? > > Thanks, > > Bas > > -- > You received this message because you are subscribed to the Google Groups > "Haskell Pipes" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to haskell-pipes+unsubscr...@googlegroups.com > <mailto:haskell-pipes+unsubscr...@googlegroups.com>. > To post to this group, send email to haskell-pipes@googlegroups.com > <mailto:haskell-pipes@googlegroups.com>. -- You received this message because you are subscribed to the Google Groups "Haskell Pipes" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipes+unsubscr...@googlegroups.com. To post to this group, send email to haskell-pipes@googlegroups.com.