BangPatterns in PatternGuards don't work like docs would suggest
Summary and Steps to reproduce
The docs don't seem to say anything special about the interaction between bang patterns and pattern guards, so I wouldn't expect them to work any differently there. And yet:
let f = case undefined of !_ -> () in f -- (a) fails (as expected) let f | let !_ = undefined = () in f -- (b) fails (as expected) let f | !_ <- undefined = () in f -- (c) succeeds...
I would expect
(c) to fail, in the same way as
Alternatively, an explanation for how BangPatterns interact with PatternGuards could be added to the "Bang patterns" section in
- GHC version used: 8.6.5, 8.8.1