Ignore my message. I think I'm looking at the wrong version of simpleHttp or something. I should have tried it in ghci before I posted.
I think what he is asking is if try (from lifted) has type
try :: (MonadBaseControl IO m, Exception e) => m a -> m (Either e a)
and simpleHttp is
simpleHttp "googe" :: IO (Result (Response ty))
then how can the whole statement have
try $ simpleHttp "goog" :: GHandler master sub (Either SomeException ByteString)
when the m in both parts of try is the same, it should end up IO not GHandler master sub. So I don't understand why this would work, either.
On Thu, Sep 27, 2012 at 1:33 PM, Brent Yorgey <byorgey@seas.upenn.edu> wrote:On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:Do you need a type signature there at all?
> On 9/26/12 6:00 PM, Ertugrul Söylemez wrote:
> >Bryce Verdier <bryceverdier@gmail.com> wrote:
> >
> >> body <- L.try (simpleHttp "http://www.google.com") :: IO (Either
> >>L.SomeException Data.ByteString.Lazy.Internal.ByteString)
> >Almost right, but your type signature is lying. =)
> >
> >
> >Greets,
> >Ertugrul
>
> Thanks for your hint, with a fair amount of head bashing against a
> wall I was able to figure this out. At the end of day I got :
>
> body <- try (simpleHttp "http://www.google.com") :: GHandler
> PlayHaven PlayHaven (Either SomeException ByteString)
-Brent
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners