Haskell newbie and Python guy here.
I think I may be missing something here but if you look at Yesod's quickstart, the autor install some packages before cabal sandbox init
. I have seen the same pattern elsewhere. Questions:
cabal sandbox init
don't change PATH in order to match the sandboxed version?Thank you very much in advance!
Yes, this how to use a sandbox.
cabal sandbox init
will create some files / directories for you that will keep track of the packages you have installed.
cabal install some_package
will install that package into the sandbox.
You are more than welcome to install yesod-bin
into a sandbox.
Read point 2
cabal sandbox init
doesn't change your path, because it doesn't really need to. Just add PATH=.cabal-sandbox/bin:$PATH
in your .bash_profile
.
Unlike virtual-env, you never need to 'enable' or 'disable' a sandbox. You just cd
into a directory, and it is automatically enabled.
The only real downside I have found to cabal sandboxes, is that you need to be in the root directory in order to act upon a sandbox. Meaning, if you are in a sub-directory, running cabal install some_package
will not install it into the sandbox that is up a level, instead it will install it into either the global or user database, depending on how you have cabal
configured.