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

Ensure eval plugin Print class doesn't rely on Prelude being in scope #1587

Merged
merged 2 commits into from Mar 18, 2021

Conversation

akrmn
Copy link
Contributor

@akrmn akrmn commented Mar 17, 2021

Hi,

This PR is pretty much what it says on the tin :)

The reason I need this is because the codebase at work uses {-# NoImplicitPrelude #-}, together with a custom prelude that includes show :: Show a => a -> Text, which doesn't play well with the Eval plugin. Currently, we get errors like:

Request workspace/executeCommand failed.
  Message: Couldn't match type ‘Text’ with ‘[Char]’
Expected type: IO String
  Actual type: IO Text

  Code: -32603 

This is because the Print class, as defined on Ide.Plugin.Eval.Code, uses whatever show is in scope. Having a qualified Prelude in scope when Print is defined should be enough to avoid that, and I can't think of any drawbacks.

Thanks for your consideration and for all the great work on HLS so far!

Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you señor Ackermann! And best wishes

@pepeiborra pepeiborra added the merge me Label to trigger pull request merge label Mar 18, 2021
@mergify mergify bot merged commit 3f2ea7c into haskell:master Mar 18, 2021
@akrmn akrmn deleted the eval-with-no-implicit-prelude branch March 18, 2021 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants