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

前端 未结 1 2053
长发绾君心
长发绾君心 2020-12-08 18:47

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 appa

相关标签:
1条回答
  • 2020-12-08 19:36

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

    0 讨论(0)
提交回复
热议问题