The hsenv package
hsenv is a tool (inspired by Python's virtualenv) to create isolated Haskell environments.
It creates a sandboxed environment in a .hsenv_ENVIRONMENT_NAME/ directory, which, when activated, allows you to use regular Haskell tools (ghc, ghci, ghc-pkg, cabal) to manage your Haskell code and environment. It's possible to create an environment, that uses a different GHC version than your currently installed system GHC. hsenv is supposed to be easier to learn (and use) than similar packages (like cabal-dev or capri).
First, choose a directory where you want to keep your sandboxed Haskell environment, usually a good choice is a directory containing your cabalized project (if you want to work on a few projects (perhaps an app and its dependent library), just choose any of them, it doesn't really matter). Enter that directory:
Next, create your new isolated Haskell environment (this is a one time only (per environment) step):
Now, every time you want to use this enviroment, you have to activate it:
That's it! Now it's possible to use all regular Haskell tools like usual, but it won't affect your globalsystem's Haskell environment, and also your per-user environment (from ~.cabal and ~/.ghc) will stay the same. All cabal-installed packages will be private to this environment, and also the external environments (global and user) will not affect it (this environment will only inherit very basic packages - mostly ghc and Cabal and their deps).
When you're done working with this environment, enter command deactivate_hsenv, or just close the current shell (with exit).
The only advanced usage is using different GHC version. This can be useful to test your code against different GHC version (even against nightly builds).
First, download binary distribution of GHC for your platform (e.g. ghc-7.0.4-i386-unknown-linux.tar.bz2), then create a new environment using that GHC
Then, proceed (with [de]activation) as in basic case.
hsenv has been tested on i386 Linux systems, but it should work on any Posix platform. External (from tarball) GHC feature requires binary GHC distribution compiled for your platform, that can be extracted with tar and installed with ./configure --prefix=PATH; make install.
For more info please consult hsenv --help or the attached README file.
[Skip to Readme]
|Versions||0.3, 0.4, 0.5|
|Dependencies||base (>=184.108.40.206 && <4.7), bytestring (>=0.9.1.7 && <0.11), Cabal (>=220.127.116.11 && <1.17), directory (>=18.104.22.168 && <1.3), file-embed (>=0.0.4.1 && <0.1), filepath (>=22.214.171.124 && <1.4), mtl (>=126.96.36.199 && <2.2), process (>=188.8.131.52 && <1.2), safe (==0.3.*), split (>=0.1.4 && <0.3), unix (>=2.0 && <2.7) [details]|
|Copyright||(c) 2011 Bartosz Ćwikłowski|
|Maintainer||Taylor Hedberg <email@example.com>|
|Source repository||head: git clone git://github.com/tmhedberg/hsenv.git|
|Uploaded||Wed Feb 27 01:34:17 UTC 2013 by TaylorHedberg|
|Downloads||3550 total (14 in the last 30 days)|
|Status||Docs not available [build log]
Successful builds reported [all 7 reports]
For package maintainers and hackage trustees