Allowed character sets for bindings/patterns/types are inconsistent
{-# LANGUAGE PatternSynonyms #-}
main :: IO ()
main = pure ()
data Pair a b = Pair a b
(###) :: a -> b -> Pair a b -- OK
(###) a b = Pair a b -- OK
a ### b = Pair a b -- OK
pattern (###) :: a -> b -> Pair a b -- error: parse error on input ‘###’
pattern a ### b = Pair a b -- error: parse error on input ‘###’
(???) :: a -> b -> Pair a b -- OK
(???) a b = Pair a b -- OK
a ??? b = Pair a b -- OK
pattern (???) :: a -> b -> Pair a b -- error: parse error on input ‘???’
pattern a ??? b = Pair a b -- error: parse error on input ‘???’
(:::) :: a -> b -> Pair a b -- Invalid type signature: (:::) :: ... Should be of form <variable> :: <type>
(:::) a b = Pair a b -- OK
a ::: b = Pair a b -- OK
pattern (:::) :: a -> b -> Pair a b -- OK
pattern a ::: b = Pair a b -- OK
Expected behavior
I would expect the same character sets to be allowed in bindings and patterns. At least https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pattern_synonyms.html doesn't give me evidence otherwise. I also would expect bindings and their signatures to allow the same character sets.
Environment
- GHC version used: happens both on 8.6.5 and 9.2.1