AntC2:
Is there a risk of confusing the kind
->with aViewPattern?
Yes. Tried initially in 9.10 with no extensions
ghci> let f ((+ 2) -> x) = x in f 7
Illegal view pattern; suggest enable the extension [correct, same reporting as prev GHCs]
— instead :set -XRequiredTypeArguments; try same input
error: [GHC-72516] Parse error in pattern: +2
— Ok, :set -XViewPatterns; parsed ok.
— BTW, advance warning:
ghci> let f ((+ 2) -> x :: Int) = x in f 7
warning: [GHC-00834] …
* Found an unparenthesized pattern signature …
* This code might stop working in a future GHC release …
(I was trying to break it :: I wouldn’t usually code that signature like that — yeuch! So I agree with the planned change to the precedence.)