我在ghci中收到此错误,我怀疑该错误并未表达实际问题。
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
这是我在ghci中做的事情来解决这个问题。首先,我加载了一些我想要使用的导入文件.Http-Enumerator与此问题相关。然后我这样做:
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
当我尝试添加实例时,它说它希望我在(* - &gt; *)上得到解析错误。这让我觉得问题出在其他地方。不知道该怎么办。照明赞赏。
答案 0 :(得分:0)
答案来自于Twey的freenode上的#haskell。
您必须指定parseUrl返回的类型。正确的用法是:
test&lt; - (parseUrl“https://pkg.cudaops.com/cgi-bin/qaLinkEditor.cgi?json=1”)::(IO(Request IO))