[Haskell-cafe] Contributing to http-conduit

Antoine Latter aslatter at gmail.com
Wed Feb 8 06:05:14 CET 2012

On Tue, Feb 7, 2012 at 10:28 PM, Myles C. Maxfield
<myles.maxfield at 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?


It should handle part of your problem, at least.


More information about the Haskell-Cafe mailing list