Make `singleConstructor` cope with pattern synonyms

Authored by sgraf on Apr 3 2019, 11:53 AM.

Description

Make singleConstructor cope with pattern synonyms

Previously, singleConstructor didn't handle singleton COMPLETE sets
of a single pattern synonym, resulting in incomplete pattern warnings
in Trac #15753.

This is fixed by making singleConstructor (now named
singleMatchConstructor) query allCompleteMatches, necessarily making
it effectful. As a result, most of this patch is concerned with
threading the side-effect through to singleMatchConstructor.

Unfortunately, this is not enough to completely fix the original
reproduction from Trac #15753 and Trac #15884, which are related to function
applications in pattern guards being translated too conservatively.

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Apr 8 2019, 2:06 PM
Parents
rGHC4dda2270d260: Use ./hadrian/ghci.sh in .ghcid
Branches
Unknown
Tags
Unknown
Marge Bot <ben+marge-bot@smart-cactus.org> committed rGHCd236d9d0f4f3: Make `singleConstructor` cope with pattern synonyms (authored by sgraf).Apr 8 2019, 2:06 PM