Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Question: can this work with LTS 12/GHC 8.4.3? #240

Open
marnen opened this issue Oct 17, 2018 · 13 comments
Open

Question: can this work with LTS 12/GHC 8.4.3? #240

marnen opened this issue Oct 17, 2018 · 13 comments

Comments

@marnen
Copy link

marnen commented Oct 17, 2018

ghc-mod master doesn’t work with GHC 8.4.3/Stack LTS 12, but according to DanielG/ghc-mod#931 , there’s a branch that does. Any thoughts on how to get that version of ghc-mod working with Atom, or is that more of a stack install question?

@lierdakil
Copy link
Contributor

Hi. To be honest, ghc-mod has been neglected for a while now. Pretty sure there are ways to make it work somewhat, but there can be no guarantees that it works as expected.

I've been meaning to jump ship to another backend provider, but it's a lot of work and I keep being distracted by other things (e.g. my day job), so I didn't manage to make much progress on that front. Sorry.

There is an option that should work reasonably well though. ide-haskell-repl has a (limited) backend provider mode, it can check for errors on save and show types on hover.

If you're feeling particularly adventurous, I've taken the branch you've mentioned and bashed it around until it compiled with LTS-12.something. No guarantees it works though.
https://github.com/DanielG/ghc-mod/tree/lierdakil/ghc-8.4.3
You can build it with

git clone --recurse-submodules https://github.com/DanielG/ghc-mod -b lierdakil/ghc-8.4.3
cd ghc-mod
stack build

I didn't even run the tests though, pretty sure a lot of those will fail.

@marnen
Copy link
Author

marnen commented Oct 17, 2018

Thanks. I’ll try ide-haskell-repl, and maybe hack on that branch (though I’m not too skilled with Haskell yet).

@lierdakil
Copy link
Contributor

Ok, cool.

FYI, I ran the tests, and most of those passed, surprisingly. Case Split doesn't seem to work at all though (but well, that much was almost certain)

@marnen
Copy link
Author

marnen commented Oct 17, 2018

Also, docs note: there’s nothing on the atom-haskell website that would let me know that ide-haskell-repl has the features you’ve described here. Perhaps that should be fixed?

@lierdakil
Copy link
Contributor

Right.

@lierdakil
Copy link
Contributor

Added a couple of paragraphs:
https://atom-haskell.github.io/extra-packages/ide-haskell-repl/#using-ide-haskell-repl-as-ide-backend

Also updated some parts of ghc-mod-with-new-ghc warning here:
https://atom-haskell.github.io/installation/installing-binary-dependencies/

If you think of something to add/change, feel free to create a PR (use the "edit this page" link at the top right corner of the corresponding website page)

@marnen
Copy link
Author

marnen commented Oct 17, 2018

Very useful—thanks so much!

@marnen
Copy link
Author

marnen commented Oct 17, 2018

Thanks again. Using the (new) existing instructions, I got ide-haskell working with -repl as backend (with stack docker: true!) without needing to specify any paths, and I’m getting warnings on save and hover type annotations. This is awesome.

@cscalfani
Copy link

Is there any way to cause the REPL to display warnings?

@lierdakil
Copy link
Contributor

@cscalfani it will respect the same settings as ghc-mod if you're running it in a cabal project using the appropriate builder configuration (cabal/stack). If all else fails, adding {-# OPTIONS_GHC -Wall #-} should work.

@cscalfani
Copy link

cscalfani commented Nov 7, 2018

Thanks. I really hate littering my code with GHC options (which does work BTW).

But setting the following does NOT:

image

Am I doing this correctly?

BTW, here is my other setting that may affect this:

image

@lierdakil
Copy link
Contributor

lierdakil commented Nov 7, 2018

Usually, people (myself included) just do something like this in the cabalfile:

ghc-options:     -Wall -fno-warn-unused-do-bind

But 'extra args' setting should work too, actually. Perhaps you just need to restart Atom for the setting to take effect?

EDIT: to clarify, changes in 'extra args' do not affect to already running GHCi instances; so, you have to restart those. And the easiest way to restart the background GHCi process is to restart Atom. Or, with recently released ide-haskell-repl 0.8.4, just killing GHCi process using OS tools will work too, it should restart automatically.

@cscalfani
Copy link

I just updated to 0.8.4 AND restarted Atom and putting -Wall in Extra Args works now.

Thank you for the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants