什么没有以下函数打字:
import qualified Control.Exception as E
import Data.Conduit (ResourceT)
import Network.HTTP.Types (Method, Status(..))
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy.Char8 as LBS
doHttps :: Method -> String
-> Maybe (RequestBody (ResourceT IO))
-> IO (Either E.SomeException (Response LBS.ByteString))
doHttps reqMethod url body = undefined
它产生以下错误:
RequestBody is applied to too many type arguments
In the type signature for `doHttps':
doHttps :: Method
-> String
-> Maybe (RequestBody (ResourceT IO))
-> IO (Either E.SomeException (Response LBS.ByteString))
Failed, modules loaded: none.
doHttps
函数是此功能的简化版本。但是显然,模块中的原始功能Typechecks中的原始功能,但上述片段不起作用。为什么会发生?
http-condit库的不同版本。在版本1中。
http://hackage.haskell.org/package/http-conduit-1.9.6/docs/network-http-conduit.html#t:requequest
但是,在版本2中。*,它不采用类型参数:
http://hackage.haskell.org/package/http-conduit-2.0.0.0.0/docs/network-http-conduit.html#tml#t:requequest