Question about IntelliJ Haskell plugin installation - why is it falling back on lts-18?

Tis is a newbie question - I do not know a lot about Haskell compilation.
I have GHCup installation - stack 2.7.5 and ghc 9.0.2.
I have a simple stack project from Exercism.
It had very old resolver number (lts-16) so I changed it to resolver: lts-19.19
I built it with with stack build --test --haddock --no-haddock-hyperlink-source.
I installed the IntelliJ plugin, restart and try to do New Project wizard select Import project from external model and check Haskell Stack. Select 2.7.5 as SDK.
Plugin then installs ghc-8.10.7 into C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ghc-8.10.7 and installs Haskell Tools (HLint, Hoogle, Ormolu, and Stylish Haskell) into C:\Users\USER\AppData\Local\rikvdkleij\intellij-haskell\cache\lts-18.
Why is that? Why is resolver: lts-19.19 (local stack.yaml) ignored?

Word of advice: VS Code is the best way (by a lot) to use Haskell with GHC today.

I have also had more fortune with cabal than stack.

Installation of the plugin is managed completely by the Haskell extension and things work very well out of the box.

I recommend against IntelliJ for Haskell

5 Likes

You might be right. I need to bite the bullet and get away from IntelliJ and start using some lighter option - VSCode or NeoVIM. I do not know how to use cabal vs stack - thanks for the pointer!

It’s a good idea to switch.

I personally recommend VSCode, having used emacs, vim+tmux, and IntelliJ. It’s the best combination of customizability and you still use full vim. If you’re really eager, you can even get full vimrc support with VSCode without too much trouble.

Stack is a developer oriented tool that is build on top of cabal. It was designed to fix a plethora of bad issues that cabal had. Cabal has now fixed the primary issues that cabal had. It used to be that cabal was a lower-level build tool, this is also much less-so the case. Stack is probably slightly easier to start a project, but in the long-run (if you plan on using Haskell for serious projects), cabal is going to give you more power without much extra pain.

1 Like

Thanks - I nuked GHCup - cleaned up all the “stack” residue in AppData folder and reinstalled GHCup - it installs older (6 months) ghc 8.10.7by default (resolver: lts-18.28) Then I installed hlint, hoogle and ormolu via caba - which means you need to provide it with version number - unless you want the current ghc 9.2.* also installed. Could not get Stylish Haskell installed that way.

So if I want to stick to cabal based project - is there a way to convert stack based project to cabal one?

1 Like