I would like to install some Haskell libraries globally, for example hindent
which is used by my editor\'s Haskell integration. What is the recommended way to do th
Well, stack install
in any project will install to ~/.local/bin
therefore making whatever executable you install be globally accessible.
The global project is used when running stack without a project, it is located in ~/.stack/global-project/stack.yaml
.
If you want all of your globally accessible tools to have the same dependencies (perhaps to ensure that the ghc version matches or something), then you could make a project intended to build all of these tools. It's up to you whether or not it is the "global project" - there's not much special about it, it's just a default if you run stack and aren't in a project.
In order to record "what haskell executables do I want installed globally", you might consider creating a shell file like
#!/bin/sh
stack install hindent
And then running this whenever you change the versions of the installed tools.
Also, for tools like intero
that need to match the ghc version, you can do stack install --copy-compiler-tool intero
, and it will be available on the PATH when stack is used with that ghc version.