Search code examples
httphaskellhaskell-lens

wreq not compiling with cabal sandbox


I'm using cabal sandbox and I got this error when compiling the wreq library:

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

I'm using these libraries in my cabal file:

    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

Any ideas how to solve the compilation error?


Solution

  • It looks like lens-4.5 is the culprit.

    Add lens >= 4.4 && < 4.5 to your cabal file and it probably will compile (it did for me.)