Skip to content

Commit 4ed7157

Browse files
committed
Add new example to 58481 and rephrase some wording in index.md
1 parent d9b88b9 commit 4ed7157

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{-# LANGUAGE PatternSynonyms #-}
2+
module Pattern where
3+
4+
pattern Head x <- x:xs
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
module Pattern where
3+
4+
pattern Head x <- x:xs
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Use of pattern synonyms without enabled language extension
3+
---
4+
5+
In this example the user declared a pattern synonym without enabling the `PatternSynonym` extension, which leads to this generic parsing error.
6+
7+
```
8+
messages/GHC-58481/example4/before/Pattern.hs:3:16: error: [GHC-58481]
9+
parse error on input ‘<-’
10+
Suggested fix: Possibly caused by a missing 'do'?
11+
|
12+
3 | pattern Head x <- x:xs
13+
| ^^
14+
```

message-index/messages/GHC-58481/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ severity: error
55
introduced: 9.6.1
66
---
77

8-
This is a generic error, indicating that GHC could not parse the code.
8+
This is a generic error, indicating that GHC could not parse the code.
99

10-
GHC contains many more explicit parsing errors with more verbose descriptions of the problem. However if the error is not separately defined there, a problem with parsing is reported with error code 58481.
10+
GHC contains many more explicit parsing errors with more verbose descriptions of the problem.
11+
However if the error is not separately defined there, a problem with parsing is reported with error code `GHC-58481`.
1112

12-
There may be many different reasons why error 58481 was given, ranging from an incorrect syntax that needs additional Haskell Language Extensions, to a expression mistakenly put in the same line as other.
13+
There may be many different reasons why the error `GHC-58481` was emitted, ranging from incorrect syntax that requires additional language extensions, to an expression mistakenly put in the same line as another.
1314

1415
Below are some examples of code that generate this generic parsing error. Please be encouraged to report more or contribute via [error-messages github](https://github.com/haskell/error-messages).

0 commit comments

Comments
 (0)