haskell / haskell/error-messages

Better suggestion for data constructors import list

Open
#59 2 comments 3 reactions 0 assignees View on GitHub
status:Composing error message tool:GHC type:error-message
Dominant language
No language data
Stars
76
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Here's an error message:
```
Data constructor not in scope:
NonRec :: Id -> GHC.Core.CoreExpr -> GHC.Core.Bind b0
Suggested fix:
• Perhaps you want to add ‘NonRec’ to the import list
in the import of ‘GHC.Core’
```

So I add `import GHC.Core (NonRec)` and I get:
```
In module ‘GHC.Core’:
‘NonRec’ is a data constructor of ‘Bind’
To import it use
import GHC.Core( Bind( NonRec ) )
or
import GHC.Core( Bind(..) )
```

The first error should suggest adding `Bind (NonRec)` directly.

The second error is good. Minor nitpick: it could use the "Suggested fix" header.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.