emacs haskell-mode default language extensions - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

James King

I like to add default extensions to my cabal file for common extensions and would like the Haskell process to pick those up and check my file with those extensions... but I set the variable to '("-XDerivingStrategies") for example. Flycheck continues to suggest the language extension. Is there a way to tell haskell-mode to use this list of extensions when starting up the ghci process?

James King

Ok... I think this customization variable is there but not really used by anything in haskell-mode.

You select hlint as your flychecker with flycheck-select-checker, which if available on your path, seems to understand your cabal configuration. It doesn't seem to work but there is a customization variable in the haskell-interactive group to turn off these language extension suggestions... seems like switching the flymake checker is key.

Next I had to set haskell-process-type to 'ghci

Then I had to add the language extensions as the ghci process parameters by adding them to the list of values in haskell-process-args-ghci.

I don't know why but the cabal-repl type for haskell-process-type doesn't seem to work well with haskell-interactive-mode.

James King

It doesn't seem like many of these can be properly set by .dir-locals.el or at least I haven't figured out the right incantation... so if your project uses a different set of default extensions.. well, you'll have to set the variables per session or update your customization group when you switch I guess?

Georgi Lyubenov // googleson78

I think hls (so lsp-mode/lsp-haskell) can figure out the extensions stuff :? what are the things that haskell-mode that lsp-haskell is not good enough at?

James King

Does lsp-mode work with ghci or ghcid?

Georgi Lyubenov // googleson78

I think it uses a ghci session to collect info from ghc