<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 9/26/12 4:53 PM, Ertugrul S&ouml;ylemez
      wrote:<br>
    </div>
    <blockquote
      cite="mid:20120927015323.2ccc028b@tritium.streitmacht.eu"
      type="cite">
      <pre wrap="">Bryce Verdier <a class="moz-txt-link-rfc2396E" href="mailto:bryceverdier@gmail.com">&lt;bryceverdier@gmail.com&gt;</a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">This is the new code that is trying to use try (imported from 
Control.Exception)
getGoogR = do
     body &lt;- try {- [...] -}

[...]

I'm sure that my problem has a simple fix, but I just don't know what
it is. I will be happy to share any other code if people ask, I'm just
giving the short version for brevities sake.
</pre>
      </blockquote>
      <pre wrap="">
The fix is indeed simple.  In fact you're just using the wrong 'try',
because Yesod handlers aren't IO actions, but actions in a monad that is
specific to your application, called Handler.  The error message
suggests that, although the type is spelled out completely there.

What you want is the lifted version of 'try', which you find in the
Control.Exception.Lifted module.


Greets,
Ertugrul</pre>
    </blockquote>
    <br>
    Thank you for the reply Ertugrul, sadly that didn't seem to help. :(<br>
    <br>
    Here are my changes:<br>
    import qualified Control.Exception.Lifted as L<br>
    ...<br>
    <br>
    &nbsp;&nbsp;&nbsp; body &lt;- L.try (simpleHttp <a class="moz-txt-link-rfc2396E" href="http://www.google.com">"http://www.google.com"</a>) :: IO
    (Either L.SomeException Data.ByteString.Lazy.Internal.ByteString)<br>
    <br>
    <br>
    I did the full qualified because the first time I tried your
    suggestion I just "Control.Exception.Lifted" and I got the same
    error as I'm sharing below.<br>
    <br>
    playhaven.hs:51:19:<br>
    &nbsp;&nbsp;&nbsp; Couldn't match expected type `IO b0'<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with actual type `GHandler sub0 master0 RepJson'<br>
    &nbsp;&nbsp;&nbsp; In the expression:<br>
    <br>
    <br>
    Thanks for being willing to help me with this.<br>
    Bryce<br>
    <br>
    <br>
    <blockquote
      cite="mid:20120927015323.2ccc028b@tritium.streitmacht.eu"
      type="cite">
      <pre wrap="">

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/beginners">http://www.haskell.org/mailman/listinfo/beginners</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>