Skip to content

Deprecate the `pattern` keyword in import and export lists

Summary

GHC Proposal #581, section 2.3, reads as follows:

Since the data specifier introduced above subsumes uses of the pattern keyword in import/export lists that are permitted under PatternSynonyms, we propose a new warning -Wpattern-namespace-specifier that warns when the pattern namespace specifier is used. Initially this warning will be added to -Wcompat.

This ticket tracks the implementation of this specific part of the proposal.

Steps to reproduce

ghci> :set -Wcompat -XPatternSynonyms
ghci> import Data.List.NonEmpty (pattern (:|))

Expected behavior

There should be a warning about the use of the pattern keyword.

Environment

  • GHC version used: 9.10.1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information