I’m getting this error in ghci, and I suspect that the error is not expressing the actual problem.
No instances for (Control.Monad.IO.Class.MonadIO
GHC.Prim.Any(* -> *),
Failure HttpException GHC.Prim.Any(* -> *))
arising from a use of `httpLbsRedirect'
Possible fix:
add instance declarations for
(Control.Monad.IO.Class.MonadIO GHC.Prim.Any(* -> *),
Failure HttpException GHC.Prim.Any(* -> *))
In the expression: httpLbsRedirect test nManager
In an equation for `it': it = httpLbsRedirect test nManager
Here’s what I do in ghci to get this problem. First I load the file that has some imports I want to play with.Http-Enumerator being the on relevant to this problem. Then I do this:
nManager <- newManager
test <- parseUrl "https://pkg.cudaops.com/cgi-bin/qaLinkEditor.cgi?json=1"
:t test :: Request GHC.Prim.Any(* -> *)
ghcifoo> httpLbsRedirect test nManager
<interactive>:1:1:
No instances for (Control.Monad.IO.Class.MonadIO
GHC.Prim.Any(* -> *),
Failure HttpException GHC.Prim.Any(* -> *))
arising from a use of `httpLbsRedirect'
Possible fix:
add instance declarations for
(Control.Monad.IO.Class.MonadIO GHC.Prim.Any(* -> *),
Failure HttpException GHC.Prim.Any(* -> *))
In the expression: httpLbsRedirect test nManager
In an equation for `it': it = httpLbsRedirect test nManager
When I try to add the instance it says it wants I get parse errors on (* -> *). This makes me think the problem lies elsewhere. Not sure what to do. Illumination appreciated.
The answer came from #haskell on freenode, by Twey.
You have to specify the type returned by parseUrl. The correct usage would be:
test <- (parseUrl “https://pkg.cudaops.com/cgi-bin/qaLinkEditor.cgi?json=1”) :: (IO (Request IO))