[Haskell-cafe] SYB: queries using IO Monad
jpmoresmau at gmail.com
Fri Nov 1 08:46:59 UTC 2013
I have code that works well using the syb package, and the ext1Q, extQ and
gmapQ functions. This code that a Data and transforms it into something
However I need to make a change, and this change involves calling a
function in the IO monad (the function is from another library so I have no
choice). However, the ext1Q, extQ and gmapQ functions have no monadic
equivalent. There seems to be monadic transformation (from a to different
a) but no monadic queries (from a to b).
Do I have to rewrite these functions myself to work with monadic queries
(it at all possible) or is there a better way? I've seen some functions
that work with monads and MonadPlus, but I don't see anything that would
work with IO.
So far I've checked that the IO() function I'm calling does the job by
using unsafePerformIO, but I know that's a sin and I'd like to find a
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe