Skip to content
Jonas Chevalier edited this page Mar 20, 2022 · 3 revisions

+ cabal sandbox

Add the following to your global ~/.config/direnv/direnvrc file:

layout_haskell() {
  PATH_add ~/.cabal/bin
  [ -d .cabal-sandbox ] || cabal sandbox init
  PATH_add .cabal-sandbox/bin
  export GHC_PACKAGE_PATH=$(cabal exec -- sh -c "echo \$GHC_PACKAGE_PATH")
}

Now in each haskell project's .envrc use the layout haskell directive to automatically create the sandbox and add .cabal-sandbox/bin to your PATH. It's also not necessary to prefix all the commands with cabal exec anymore.

+ stack

https://meinwords.wordpress.com/2018/02/19/my-haskell-setup/

Clone this wiki locally