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

Non-exaustive Pattern Match #90

Open
JorisBlanken opened this issue Jan 5, 2020 · 4 comments
Open

Non-exaustive Pattern Match #90

JorisBlanken opened this issue Jan 5, 2020 · 4 comments

Comments

@JorisBlanken
Copy link

Looks like there is a non-exhaustive pattern match here:
https://github.com/DanielG/cabal-helper/blob/master/lib/Distribution/Helper.hs#L603

This is causing the following error for me using HIE through the Haskell Language Server extension in vscode:
hie-wrapper: user error (Pattern match failure in do expression at lib\Distribution\Helper.hs:603:7-22)

The error is preceeded by the following, which might be the cause of an empty list.

'stty' is not recognized as an internal or external command,
operable program or batch file.

Full HIE log:

2020-01-04 21:37:03.1001694 [ThreadId 3] - run entered for hie-wrapper(hie-wrapper) Version 1.0.0.0, Git revision a8c156b8a12d03c9eb4a23174eaac1eb9725eff1 (3539 commits) x86_64 ghc-8.6.5
2020-01-04 21:37:03.1021712 [ThreadId 3] - Current directory:d:\source\demo-project
2020-01-04 21:37:03.1021712 [ThreadId 3] - Operating system:mingw32
2020-01-04 21:37:03.1031721 [ThreadId 3] - Cabal-Helper found these projects: ["ProjLocStackYaml {plStackYaml = \"d:\\\\source\\\\demo-project\\\\stack.yaml\"}"]
2020-01-04 21:37:03.1041732 [ThreadId 3] - These projects have the build tools installed: ["ProjLocStackYaml {plStackYaml = \"d:\\\\source\\\\demo-project\\\\stack.yaml\"}"]
2020-01-04 21:37:03.1041732 [ThreadId 3] - Cabal-Helper dirs: ["d:\\source\\demo-project","d:\\source\\demo-project\\File.hs"]
'stty' is not recognized as an internal or external command,
operable program or batch file.
'stty' is not recognized as an internal or external command,
operable program or batch file.
hie-wrapper: user error (Pattern match failure in do expression at lib\Distribution\Helper.hs:603:7-22)
[Error - 9:37:04 PM] Connection to server got closed. Server will not be restarted.

I realize that this issue might stem from HIE, but I wanted to make you aware of the ungraceful exit due to the failed pattern matching.

@hasufell
Copy link
Collaborator

hasufell commented Jan 5, 2020

Looks like there is a non-exhaustive pattern match here:

This isn't technically a non-exhaustive pattern, it's syntax sugar for MonadFail.

@JorisBlanken
Copy link
Author

Looks like there is a non-exhaustive pattern match here:

This isn't technically a non-exhaustive pattern, it's syntax sugar for MonadFail.

Good point, so is this something that should be fixed on hie-wrapper's end then?

@DanielG
Copy link
Owner

DanielG commented Jan 7, 2020

I suppose at the very least the error handling here could be better. listPackageCabalFiles should really just return a NonEmpty and produce a nice error message when no cabal files are returned by stack.

@DanielG DanielG reopened this Jan 7, 2020
@Hypnoes

This comment has been minimized.

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

4 participants