http - wreq 不使用 cabal 沙箱进行编译

标签 http haskell haskell-lens

我正在使用 cabal 沙箱,在编译 wreq 库时出现此错误:

Network/Wreq/Lens/Machinery.hs:20:58:
    Couldn't match type `[Name]' with `Name'
    Expected type: Name -> [Name] -> Name -> [DefName]
      Actual type: [Name] -> Name -> [DefName]
    In the return type of a call of `fieldName'
    Probable cause: `fieldName' is applied to too many arguments
    In the second argument of `(.~)', namely `fieldName id'
    In the second argument of `(&)', namely `lensField .~ fieldName id'
Failed to install wreq-0.2.0.0

我在我的 cabal 文件中使用这些库:

    base >=4.6 && <4.7,
    bytestring >=0.10 && <0.11, 
    aeson >=0.7 && <0.8,
    yaml-config >= 0.2.0 && < 0.3,
    HTTP >= 4000.0.7 &&< 4001,
    base64-string >= 0.2 && < 0.3,
    wreq >= 0.2.0.0 && < 0.3

有什么解决编译错误的办法吗?

最佳答案

看起来像lens-4.5是罪魁祸首。

添加lens >= 4.4 && < 4.5到你的 cabal 文件,它可能会编译(它为我做了。)

关于http - wreq 不使用 cabal 沙箱进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26704386/

相关文章:

haskell - 使用镜头的 3 种或更多类型之间的同构

arrays - 如何在 http header 中传递数组?

http - 不可处理的内容类型是否有正确的 HTTP 状态代码?

c++ - 适用于 Windows CE/Mobile 的 C++ HTTP Websockets 客户端库

javascript - 显式类型传递是否不等同于类型推断(就表达能力而言)?

haskell - 使用镜头访问不存在的字段时如何避免默认返回值?

javascript - Node : Know when all http requests are finished

regex - Haskell 和正则表达式与交叉点

Haskell:安全 'show'

haskell - "compose"怎么是iso的?