Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
880 views
in Technique[技术] by (71.8m points)

haskell - How can I use GHCi with the new cabal 1.17 sandboxes?

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.

Is there some incantation I can use to work around this and get something similar to cabal-dev ghci?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

edit (August 2013): The cabal repl patches have recently been merged. This functionality will be a part of the next release.


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

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...