Skip to content

Pattern match warnings are per Match, not per GRHS

Motivation

Consider this binding:

f :: () -> ()
f _
  | False = ()
  | otherwise = ()

This currently won't generate a warning. This program, however, will:

f :: () -> ()
f _
  | False = ()
f _       = ()

This is because we currently report redundancy and inaccesibility warnings per match, not per guarded RHS.

Proposal

Report warnings per guarded RHS.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information