如何在ghci堆栈中使用自定义前奏?

时间:2019-01-22 18:13:21

标签: haskell stack ghci

我添加了一个自定义的前奏,它对于stack buildstack test来说效果很好。但是,stack ghci不喜欢它,因为它似乎试图一次加载所有这些内容:

$ stack --nix ghci
XXX-0.1.0.0: initial-build-steps (lib + exe)
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: XXX

* * * * * * * *

Error: Multiple files use the same module name:
       * Prelude found at the following paths
         * XXX/server/Prelude.hs (XXX:exe:XXX.exe)
         * XXX/src/Prelude.hs (XXX:lib)
         * XXX/tests/Prelude.hs (XXX:exe:tests.exe)
* * * * * * * *

Not attempting to start ghci due to these duplicate modules.

首先,解释三个不同的Prelude.hs文件:它们是相同的,因为其中两个是指向第三个文件的符号链接;在没有将我的Prelude.hs暴露给依赖库的情况下,我没有想到一种更好的方法。

一个可能的解决方法是告诉堆栈/ ghci仅加载库代码(在这种情况下位于src下),或者更好的是,能够告诉它跳过特定的.hs文件正在加载。

0 个答案:

没有答案
相关问题