haskell - Getting data out of rawQuery using Conduits -


i admit not understand conduits given limited haskell knowledge. appreciate if can guide me on how accomplish task: take output of rawquery action , store in variable can use again in hamlet file. example:

let sql = "select sum(value) total, category person group category order total desc;"    --- ??  how store rundb output in variable? rundb $ rawquery sql [] $$ cl.map (convertfrompersistent)       convertfrompersistent [] = nothing     convertfrompersistent [persistint64 sum,persistint64 category] = (sum,category)     convertfrompersistent _ = nothing 

when do

rundb $ rawquery sql [] $$ cl.mapm_ (liftio. print. convertfrompersistent)  

i see output in log file. however, pipe output array of tuples can work in hamlet file. appreciate help!

thanks,

by trial , error found works:

res <- rundb $ rawquery sql [] $$ cl.map (convertfrompersistent) =$ cl.consume