1

我正在使用 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

任何想法如何解决编译错误?

4

1 回答 1

2

看来lens-4.5是罪魁祸首。

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

于 2014-11-02T21:50:43.390 回答