Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal sandbox not being used #27

Closed
lukehoersten opened this issue Feb 2, 2015 · 14 comments
Closed

Cabal sandbox not being used #27

lukehoersten opened this issue Feb 2, 2015 · 14 comments
Labels

Comments

@lukehoersten
Copy link

My user package database has transformers-0.3 and my sandbox package database has transformers-0.4 but flycheck-haskell is transformers-0.3 and incorrectly reporting errors. I suspect the user package database is taking precedence over the sandbox package db but it shouldn't.

@lukehoersten
Copy link
Author

I was able to get things working with Chris Done's flycheck-haskell which uses ghci instead of ghc:

https://github.com/chrisdone/haskell-flycheck

I don't think this runs hlint though.

@swsnr
Copy link
Contributor

swsnr commented Feb 4, 2015

@lukehoersten It chains to the built-in hlint checker, so hlint should run either way.

As for the actual issue, please show me the output of C-c ! C-c RET haskell-ghc.

@lukehoersten
Copy link
Author

   13  18 error           Could not find module ‘Control.Monad.Trans.Except’
Perhaps you meant
  Control.Monad.Trans.Cont (from transformers-0.3.0.0)
  Control.Monad.Trans.Error (from transformers-0.3.0.0)
  Control.Monad.Trans.List (from transformers-0.3.0.0)
Use -v to see a list of the files searched for.... (haskell-ghc)

@lukehoersten
Copy link
Author

@chrisdone and I have done some work to bring his chrisdone/haskell-flycheck#1 up to snuff. Basically modern haskell-mode uses haskell-interactive-mode for a REPL which is cabal repl underneath. This unifies sandbox management etc all under one roof. With Chris' haskell-flycheck, it actually shares that cabal repl process for type checking etc. I really think this is the way to go for flycheck-haskell. Also, I think it simplifies a lot of what flycheck-haskell is doing by leveraging cabal repl for it instead (so less for you to maintain). What do you think @lunaryorn?

@swsnr
Copy link
Contributor

swsnr commented Feb 5, 2015

@lukehoersten That's the output of the error list, not of C-c ! C-c

With regards to haskell-flycheck: This extension does not actually implement a syntax checker. It merely configures the built-in GHC syntax checker of Flycheck accordingly.

Flycheck itself will never use Haskell Interactive Mode for syntax checking: I want no dependencies on specific 3rd party modes in Flycheck, and it's too much code for me to maintain anyway.

We could merge this extension with Chris' syntax checker, though, and distribute it as one package on MELPA.

But in any case, the standard GHC syntax checker and the functionality provided by this extension will stay. Not everyone uses Interactive Haskell Mode…

@lukehoersten
Copy link
Author

  1. I think we can close this issue. I can't reproduce the issue with the haskell-ghc checker.
  2. The haskell-process stuff is included in haskell-mode. Do you mean you don't want to depend on haskell-mode as a 3rd party mode?

@swsnr
Copy link
Contributor

swsnr commented Feb 5, 2015

@lukehoersten Ad 1) Closing as invalid then.

Ad 2) Exactly. I do not want to depend on Emacs Lisp functionality from other modes. That'd open a kitchen sink, and amount to more code than I could reasonably maintain. For this reason, I prefer to have syntax checkers with such dependencies in external packages.

@swsnr swsnr closed this as completed Feb 5, 2015
@swsnr swsnr added the invalid label Feb 5, 2015
@lukehoersten
Copy link
Author

OK that makes a lot of sense. Can we do what you suggested then and add the haskell-process checker to the flycheck-haskell package? My main motivation is to just get it into emacs package management so installation is easy and having flycheck-haskell and haskell-flycheck will just be confusing for new users.

@swsnr
Copy link
Contributor

swsnr commented Feb 5, 2015

@lukehoersten Yes, if @chrisdone agrees.

@chrisdone
Copy link

I'm okay with merging this into flycheck-haskell if it unifies a common thing and avoids confusion. I'm concerned about pissing off your users by swapping out the backend with something that requires starting a session and ghci (things that people regularly complain about as being such a chore).

@lukehoersten
Copy link
Author

I was thinking flycheck-haskell would default to it's current behavior and whether by manual config or auto-config on availability of haskell-process, would switch from haskell-ghc checker to haskell-process checker. @chrisdone mentioned on IRC that this would have a conditional dependency, though, which may not be desirable. I'm not sure what's best here.

@swsnr
Copy link
Contributor

swsnr commented Feb 6, 2015

@lukehoersten What do you mean with “conditional dependency”? This extension already depends on Haskell Mode.

@chrisdone With a proper predicate, Flycheck won't use the checker unless there is a session already. Is there a function that checks whether the current Haskell Mode has an interactive session attached?

@chrisdone
Copy link

There's haskell-session-maybe which returns nil if there is no session.

@swsnr
Copy link
Contributor

swsnr commented Feb 6, 2015

@chrisdone That looks like the right function to call, i.e. :predicate haskell-session-maybe

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

No branches or pull requests

3 participants