
I think what he is asking is if try (from lifted) has type
try :: (MonadBaseControlhttp://hackage.haskell.org/packages/archive/monad-control/0.3.1.4/doc/html/C...
IOhttp://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/System-IO....m,
Exceptionhttp://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Control-Ex...e)
=> m a -> m (
Eitherhttp://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Data-Eithe...e
a)
and simpleHttp is
simpleHttp "googe" ::
IOhttp://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/System-IO....(
Resulthttp://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-Str...(
Responsehttp://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-HTT...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
On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:
On 9/26/12 6:00 PM, Ertugrul Söylemez wrote:
Bryce Verdier
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)
Do you need a type signature there at all?
-Brent
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners