Unidirectional pattern signatures do not need to be invariant w.r.t. higher-rank polymorphism
Best explained by example:
data T = MkT (forall a. a -> a)
pattern PT :: (Int -> Int) -> T
pattern PT x <- MkT x
This looks perfectly reasonable to me. And the hand-written matcher is also accepted. Note that a similar bidirectional pattern synonym should indeed be rejected.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |