haskell / haskell/error-messages

Incorrect usage of the term "bang-pattern"

Open
#36 11 comments 1 reaction 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

Given the following module:
```hs
module Bang where

z = let !(x,y) = (1,2) in x
```
We get the following error message:

```
Bang.hs:3:9: error:
Illegal bang-pattern (use BangPatterns):
! (x, y)
|
3 | z = let !(x,y) = (1,2) in x
| ^^^^^^
```

which is incorrect, this is a [strict binding](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/strict.html#strict-bindings), not a bang pattern.

Suggested error message:
```
Bang.hs:3:9: error:
Illegal strict binding (use BangPatterns):
! (x, y)
|
3 | z = let !(x,y) = (1,2) in x
| ^^^^^^
```

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.