繁体   English   中英

Haskell堆栈版本依赖性

[英]Haskell stack version dependencies

堆栈新手。 我开始构建并发的web scraper ,并运行stack new my-project simple my-project.cabal我必须插入hxt,url,http和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

当我运行stack build ,我得到了:

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.

在可执行指令下插入allow-newer: true似乎不起作用,并添加诸如http == *版本后缀会导致解析错误,并给它提供http == 4000.3.9,因为黑客文档给我的http must match ==4000.3.9, but the stack configuration has no specified version

有没有一种简单的方法可以告诉集团文件我需要最新版本?

Hackage中没有名为http的软件包。 但是您有一个名为HTTP的包。

因此,固定软件包名称应该可以为您解决问题。

(此外,博客文章似乎已经过时了,最近进行HTTP请求的标准方法是通过管道/ wreq / req)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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