haskell / haskell/error-messages

Parse erorr on input `->`

Open
#19 1 comment 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

From [stackoverflow](https://stackoverflow.com/questions/69122820):

```haskell
concat [[a]] -> [a]
concat xss = [x | xs <- xss, x <- xs]
```

Produces the error:

```
Test.hs:1:14: error: parse error on input ‘->’
|
1 | concat [[a]] -> [a]
| ^^
```

Which is not very descriptive. Perhaps GHC knows enough to be able to suggest adding `::`? Maybe the `->` token can be used to infer that the user probably meant to write a type signature?

Actually, I think this is very similar to #14 in the sense that the compiler starts parsing a top-level splice. But in this case the suggestion to use ` = ` is not right.

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.