The type of a pattern synonym like
pattern FOO = 1234
seems to be '(Eq a, Num a) => a', which makes partially makes sense, although it's not immediately clear to me where the 'Eq a' part comes from. But probably that would be clear if I read the desugaring rules closely enough. ;-) My real question is about:
pattern FOO = 1234 :: Int
This doesn't compile out of the box, GHC seems to require ScopedTypeVariables, too:
Illegal type signature: `Int'
Perhaps you intended to use ScopedTypeVariables
In a pattern type-signature
Why is this the case? From a user perspective, the error is totally bogus, there are no visible type variables at all. Can GHC be fixed to avoid enabling ScopedTypeVariables?
Cheers,
S.