How do I specify the sandbox directory for runhaskell?

By default, runhaskell seems to ignore common sandbox paths.

When running the haskell file from the command line using runhaskell, how do I set the sandbox directory?

+3


source to share


1 answer


Sandboxes are a Cabal-specific concept and runhaskell (and the rest of the GHC suite) have no idea about them. A related concept in GHC is the package database path, which can be controlled by either command line flags such as -package-db

or an environment variable GHC_PACKAGE_PATH

. runhaskell

doesn't seem to support -package-db

, so customization GHC_PACKAGE_PATH

is the best bet. Or, of course, you can let Cabal get the job done cabal exec

, as Daniel Wagner pointed out in a comment.



cabal exec

works by setting GHC_PACKAGE_PATH

, so if for some reason you want to manually set a variable, you can see what value Cabal is setting with the command cabal exec printenv GHC_PACKAGE_PATH

.

+3


source







All Articles