Packages
Haskell packages can be installed in user level (global, like npm install -g
)
or project level (local, like npm install
).
The default behavior of cabal is user level:
cabal install <package-name>
To install package in project level, you need create a sandbox beforehand:
cabal sandbox init # run in project root folder
cabal install <package-name>
The global packages are stored in $HOME/.cabal/packages folder, while local packages are stored in $PROJ_ROOT/.cabal-sandbox/lib folder.