如何覆盖 haskell 项目中的上限?

how do I override upper-bounds in a haskell project?

我想使用 kind equality,它目前似乎只出现在 GHC head 中。

我安装了 GHC 系统,并在我的项目中添加了 snapshot.yaml

resolver: nightly-2016-12-31
compiler: ghc-8.1.20170103

并相应地更新了stack.yaml

resolver:
  name: snapshot
  location: snapshot.yaml

我可以看到使用 stack path 它选择了正确的编译器。

当我构建我的项目时,我现在有

In the dependencies for array-0.5.1.1:
    base-4.10.0.0 must match >=4.5 && <4.10 (latest applicable is 4.9.0.0)
needed due to bookkeeper-0.2.4 -> array-0.5.1.1

如何从我的项目中覆盖 array-0.5.1.1 声明的上限,这可能 实际上 不需要?

你的主要问题是 nightly-2016-12-31 快照 uses GHC 8.0.1 and base 4.9.0.0, and so it is incompatible with your installation of GHC 8.1. It should be enough to set the resolver to ghc-8.1.20170103, so that no snapshots are used. (There is also a system-ghc 选项;但是,考虑到 Stack 已经在使用正确的编译器,我想没有必要打开它。)如果你需要没有与 GHC 捆绑在一起的包,你必须将它们添加到 extra-deps 中的 stack.yaml(如果您已经有一个指定依赖项的 .cabal 文件,stack solver --update-config 可用于自动填充)。