<div class="gmail_quote">On Thu, Sep 27, 2012 at 7:38 PM, Bryce Verdier <span dir="ltr"><<a href="mailto:bryceverdier@gmail.com" target="_blank">bryceverdier@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 class="im">On 9/27/12 10:33 AM, Brent Yorgey wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 9/26/12 6:00 PM, Ertugrul Söylemez wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Bryce Verdier <<a href="mailto:bryceverdier@gmail.com" target="_blank">bryceverdier@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
body <- L.try (simpleHttp "<a href="http://www.google.com" target="_blank">http://www.google.com</a>") :: IO (Either<br>
L.SomeException Data.ByteString.Lazy.Internal.<u></u>ByteString)<br>
</blockquote>
Almost right, but your type signature is lying. =)<br>
<br>
<br>
Greets,<br>
Ertugrul<br>
</blockquote>
Thanks for your hint, with a fair amount of head bashing against a<br>
wall I was able to figure this out. At the end of day I got :<br>
<br>
body <- try (simpleHttp "<a href="http://www.google.com" target="_blank">http://www.google.com</a>") :: GHandler<br>
PlayHaven PlayHaven (Either SomeException ByteString)<br>
</blockquote>
Do you need a type signature there at all?<br>
<br>
-Brent<br>
</blockquote></div>
That is an awesome question. Originally I tried:<div class="im"><br>
<br>
body <- try (simpleHttp "<a href="http://www.google.com" target="_blank">http://www.google.com</a>")</div></blockquote><div><br>this can be made to work by adding less stuff :<br><br><br>> getGoogR = do<br>
> body <- try (simpleHttp "<a href="http://www.google.com" target="_blank">http://www.google.com</a>")<br><div id=":1fe">
> case body of<br>
> Left (SomeException _) -> jsonToRepJson $ object ["response" .= ( show "ERROR: NO DATA FOR ONE REASON OR ANOTHER")]<br>> Right val -> jsonToRepJson $ object ["response" .= (showDigest $ sha1 val)]<br>
<br>I think that should work...<br><br>-- <br>Jedaï<br></div></div></div>