<div dir="auto">Thanks. The air is clearing up a bit. <div dir="auto"><br></div><div dir="auto">Any reason for "error" and "catch" to be in different packages? Or, why isn't "catch" in prelude?</div><div dir="auto"><br></div><div dir="auto">"catch" needs a action in IO. What if I have an action in MonadIO?</div><div dir="auto"><br></div><div dir="auto">-- Saurabh. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 Dec 2016 8:00 am, "Brandon Allbery" <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">whoops, pressed wrong key...<div><br></div><div>No guarantees are made as to when the exception thrown by `throw` occurs; this allows it to be thrown from pure code. `throwIO` is sequenced as any other I/O operation, so you have some guarantee as to I/O operations before the `throwIO` being performed.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 9:28 PM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span>On Thu, Dec 15, 2016 at 8:42 PM, Saurabh Nanda <span dir="ltr"><<a href="mailto:saurabhnanda@gmail.com" target="_blank">saurabhnanda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">* What exactly is done by the "error" function? How does one "trap" those errors and react to it? Can "catch" trap those errors? What is "e" in the case of errors raised by "error"?</div><div dir="auto"></div></blockquote><div><br></div></span><div>`error` specifically raises a UserError exception, with a user-specified payload (message). `catch` can catch them as such.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">* How is "error" different from "throw" and "throwIO" (in the Control.Exception package, I believe)</div><div dir="auto"></div></blockquote></span></div><br>`throw` (for pure code / asynchronous) and `throwIO` (for code in IO) can throw any exception. No guarantees are made as to when the exception thrown by `throw`<span class="m_-7190253823080072306HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-7190253823080072306m_7680743855748538699gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-7190253823080072306gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div>
</blockquote></div></div>