我如何在新的cabal 1.17沙箱中使用GHCi? [英] How can I use GHCi with the new cabal 1.17 sandboxes?
问题描述
我一直在试用支持类似于cabal-dev的沙箱的cabal头。然而,目前还不支持 cabal-dev ghci
等效和显然没有计划的支持下一个版本。
I've been trying out cabal head which has support for sandboxes similar to cabal-dev. However there's not yet support for a cabal-dev ghci
equivalent and apparently no support planned for the next release.
是否有一些咒语可以用来解决这个问题,并得到类似于 cabal-dev ghci
?
Is there some incantation I can use to work around this and get something similar to cabal-dev ghci
?
推荐答案
edit(2013年8月):
edit (August 2013): The cabal repl
patches have recently been merged. This functionality will be a part of the next release.
在撰写本文时,没有简单易用的类似于 cabal-dev ghci
。我们计划在将来添加 cabal repl
命令 - 但是,此功能目前不在Cabal HEAD中。
As of this writing, there is no easy-to-use analogue to cabal-dev ghci
. We plan to add a cabal repl
command in the future - however, at the moment this functionality is not in Cabal HEAD.
在此期间,您可以尝试以下解决方法:
In the meantime, you can try the following workaround:
$ cd $YOUR_PACKAGE_DIR
# For GHC >= 7.6
$ ghci -no-user-package-db -package-db .cabal-sandbox/i386-linux-ghc-7.6.1-packages.conf.d
# For GHC < 7.6
$ ghci -no-user-package-conf -package-conf .cabal-sandbox/i386-linux-ghc-7.4.2-packages.conf.d
这不会使您的软件包模块立即从 ghci
可用 - 您必须使用加载它们:l
或 import
(它可以在自定义预处理器和CPP出现时中断)。
This won't make the modules of your package immediately available from ghci
- you will have to load them with :l
or import
(which can break in the presence of custom preprocessors and CPP).
这篇关于我如何在新的cabal 1.17沙箱中使用GHCi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!