<div dir="ltr">Hello cafe,<div><br></div><div>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 else.</div><div>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).<br clear="all">
<div>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.</div>
<div>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 better way!</div><div><br></div><div>Thanks!</div><div><br>
</div><div>JP</div><div><br></div>-- <br>JP Moresmau<br><a href="http://jpmoresmau.blogspot.com/">http://jpmoresmau.blogspot.com/</a>
</div></div>