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

IO mzero error when reading cabal configuration #110

Open
jlavelle opened this issue Oct 24, 2020 · 2 comments
Open

IO mzero error when reading cabal configuration #110

jlavelle opened this issue Oct 24, 2020 · 2 comments

Comments

@jlavelle
Copy link

Every time I try to run flycheck-haskell-setup I get an error:

Reading Haskell configuration failed with exit code 1 and ouput:
get-cabal-configuration.hs: user error (mzero)

That is the error generated by the MonadPlus instance of IO when mzero is evaluated, it seems it must be coming from an imported function that is partial.

I'm trying to use this package through a Nix shell so that's probably part of the problem, but it is difficult to figure out what is going wrong without knowing where that error is coming from.

@sergv
Copy link
Contributor

sergv commented Oct 24, 2020

Yeah it looks like it will take some time to figure out which partial function lead to this error. Since I don't use Nix, I cannot even start guessing about common pitfalls you may have encountered.

To my mind only 3 possible ways to go forward with this come up:

  • Debug it yourself (via print statements for better or worse) and provide your observations here. You can run the get-cabal-configuration.hs script in project root via runghc and experiment with it
  • Make up reproducible example that I can debug (via print statements). May or may not work depending on how complicated Nix setup will be required
  • Avoid flycheck-haskell. You have 2 options:
    • for simple use cases a baseline flycheck may be enough as this project only provides configuration for checkers there
    • consider alternative checkers provided by other projects - the errors will still be presented via flycheck framework, just the checking machinery will differ. That's what I ultimately did and personally I would recommend https://github.com/jyp/dante as it's pretty reliable in my experience and provides some nice features over vanilla flycheck, e.g. get type at point. Cannot comment on how well it works under Nix since I haven't tried it, but there is definitely some default configuration for Nix.

@jlavelle
Copy link
Author

Thanks for the quick response! I'll look into dante as an alternative.

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

No branches or pull requests

2 participants