简体   繁体   中英

Haskell stack version dependencies

New to Stack. I'm starting to build a concurrent web scraper , and ran stack new my-project simple . In my-project.cabal I have to insert the dependencies for hxt, url, http, and maybet.

executable my-project
  hs-source-dirs:      src
  main-is:             Main.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.7 && < 5,
                       time,
                       hxt,
                       http,
                       maybet

When I run stack build , I get this:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for my-project-0.1.0.0:
    http must match -any, but the stack configuration has no specified version
    maybet must match -any, but the stack configuration has no specified version
needed since my-project is a build target.

Some potential ways to resolve this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Inserting allow-newer: true under the executable directive doesn't seem to work and adding version suffixes like http == * gives a parse error, and giving it http == 4000.3.9, as per the hackage docs gives me http must match ==4000.3.9, but the stack configuration has no specified version

Is there an easy way to tell the cabal file that I want the newest version?

There is no package named http in Hackage. But you have a package named HTTP .

So, fixing the package name should resolve the problem for you.

(Also the blog article seems quite outdated, the standard way of doing HTTP request is via conduit/wreq/req these days).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM