cabal-sandbox

How can I use GHC with a cabal sandbox that's not in the current working directory?

℡╲_俬逩灬. 提交于 2020-01-04 05:58:43
问题 If I create a cabal sandbox with cabal sandbox init , I can use cabal repl or cabal exec ghc(i) to work with those packages without creating a project: $ mkdir /tmp/example && cd /tmp/example $ cabal sandbox init $ cabal install QuickCheck $ cabal exec ghci Prelude> :m Test.QuickCheck Prelude Test.QuickCheck> However, if I change the path to something else, even to a subdirectory, I cannot access the packages anymore: $ mkdir -p /tmp/example/sub && cd /tmp/example/sub $ cabal exec ghci