Install inconsistency ghcup and stack


#1

I am just starting to learn Haskell.

On Linux I installed using ghcup. I then installed stack as the ghcup install page for the generic Linux instructions (https://www.haskell.org/platform/linux.html#linux-generic) suggest. One inconsistency is that the ghcup install page itself (https://www.haskell.org/ghcup/) makes no mention of stack.

ghcup was done as an ordinary user (as the web page says) but for stack I had to use sudo which surprised me (and requires more trust). Anyway, I installed stack but then got a warning:

WARNING: '/home/mark/.local/bin' is not on your PATH.
    For best results, please add it to the beginning of PATH in your profile.

This made no sense because although ~/.local/bin isn’t on my PATH, stack was installed to /usr/local/bin/stack and /usr/local/bin is on my PATH. (Or course, I’d have rather it didn’t need sudo and was actually installed in ~/.local/bin.)


#2

The instructions for getting a generic Linux Haskell development environment set up are confusing to me. In particular this section:

The recommended way to install the components of the generic platform is using ghcup to install ghc and cabal-install, and following the instructions at haskellstack.org to install stack.

It seems like it’s saying: “First install ghcup, then install Stack.” However I think what it means is: “You should either install ghcup, or install Stack.” In general, Stack manages your GHC installation, so you don’t need to use ghcup to do that if you’re going to use Stack.

As for the PATH thing, Stack is warning you about executables installed with Stack, not the stack executable itself. If you run stack install pandoc, Stack will build Pandoc and put the executable in ~/.local/bin. Since that isn’t on your PATH, you won’t be able to run pandoc in your shell without giving it the fully qualified path, like /home/mark/.local/bin/pandoc.


#3

https://www.haskell.org/downloads/

https://www.haskell.org/ghc/download.html

Personally, I’m running a bootstrapped ghc-8.6.5.

bash-4.3$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
bash-4.3$ ~/.cabal/bin/cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library 
bash-4.3$ 

I think J. MacFarlane’s pandoc has pre-compiled binaries available.