我使用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
如何解决编译错误?
答案 0 :(得分:2)
看起来lens-4.5
是罪魁祸首。
将lens >= 4.4 && < 4.5
添加到您的cabal文件中,它可能会编译(它为我做了。)