diff --git a/message-index/messages/GHC-58481/example4/after/Pattern.hs b/message-index/messages/GHC-58481/example4/after/Pattern.hs new file mode 100644 index 00000000..9584eb2f --- /dev/null +++ b/message-index/messages/GHC-58481/example4/after/Pattern.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE PatternSynonyms #-} +module Pattern where + +pattern Head x <- x:xs diff --git a/message-index/messages/GHC-58481/example4/before/Pattern.hs b/message-index/messages/GHC-58481/example4/before/Pattern.hs new file mode 100644 index 00000000..e75516ee --- /dev/null +++ b/message-index/messages/GHC-58481/example4/before/Pattern.hs @@ -0,0 +1,4 @@ + +module Pattern where + +pattern Head x <- x:xs diff --git a/message-index/messages/GHC-58481/example4/index.md b/message-index/messages/GHC-58481/example4/index.md new file mode 100644 index 00000000..3e7d7bba --- /dev/null +++ b/message-index/messages/GHC-58481/example4/index.md @@ -0,0 +1,14 @@ +--- +title: Use of pattern synonyms without enabled language extension +--- + +In this example the user declared a pattern synonym without enabling the `PatternSynonym` extension, which leads to this generic parsing error. + +``` +messages/GHC-58481/example4/before/Pattern.hs:3:16: error: [GHC-58481] + parse error on input ‘<-’ + Suggested fix: Possibly caused by a missing 'do'? + | +3 | pattern Head x <- x:xs + | ^^ +``` diff --git a/message-index/messages/GHC-58481/index.md b/message-index/messages/GHC-58481/index.md index c61105bd..bf09df64 100644 --- a/message-index/messages/GHC-58481/index.md +++ b/message-index/messages/GHC-58481/index.md @@ -5,10 +5,11 @@ severity: error introduced: 9.6.1 --- -This is a generic error, indicating that GHC could not parse the code. +This is a generic error, indicating that GHC could not parse the code. -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. +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 `GHC-58481`. -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. +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. 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).