Haskell cabal 中 base 的依赖冲突

Dependency conflicts of base in Haskell cabal

出现cabal的base.cabal文件中的依赖冲突的问题,看来我的base版本太高了,有什么办法在 cabal sandbox.

中降级我的 base 包版本
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: decafc-0.0.0 (user goal)
[__1] next goal: base (dependency of decafc)
[__1] rejecting: base-4.11.1.0/installed-4.1... (conflict: decafc => base>=4.5
&& <=4.9)
[__1] rejecting: base-4.11.1.0, base-4.11.0.0, base-4.10.1.0, base-4.10.0.0,
base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0,
base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0,
base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0,
base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0,
base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
[__1] fail (backjumping, conflict set: base, decafc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, decafc
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unrstering the offending packages or
recreating the sandbox.

还有一个问题就是在使用stack的时候,如果运行stack build如何给alex加上一些flags,比如cabal指令是cabal install --alex-options="--ghc --template=\"$TOP/alex\""。那么如何让stack做同样的事情呢?

base 依赖项表明它仅适用于 4.5 和 4.9 之间的版本。这意味着您可以使用此软件包的最新 GHC 是 8.0.1,因为 base 随 GHC 一起提供并且无法升级。您可以自己增加依赖性,但您可能不得不修复由于 base 中的更改而不再起作用的东西,或者您可以安装旧版本的 GHC。