On Tue, Feb 7, 2012 at 10:28 PM, Myles C. Maxfield
<myles.maxfi...@gmail.com> wrote:
> I have been looking around at possibly making a Browser module for
> Network.HTTP.Conduit on top of Control.Monad.State. I came across this
> roadbump:
>
> In order to implement redirection following, client code must call 'http'
> with a redirection count of 0. If there is a redirect, 'http' will throw an
> exception. In order to catch this exception and continue on with the
> redirection chain, the 'catch' function must be called. The problem is that
> the 'catch' function has a type of (catch :: Exception e => IO a -> (e -> IO
> a) -> IO a) which means that it can only be used in the IO monad. A call to
> 'http' inside the first argument of 'catch' must be wrapped in a
> 'runResourceT'
>

Does this help?

http://hackage.haskell.org/packages/archive/lifted-base/0.1.0.3/doc/html/Control-Exception-Lifted.html

It should handle part of your problem, at least.

Antoine

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to