Skip to content

Fix SpecConstr

Simon Peyton Jones requested to merge wip/T24282 into master

This MR makes three improvements to SpecConstr: see #24282 (closed)

  • It fixes an outright (and recently-introduced) bug in betterPat, which was wrongly forgetting to compare the lengths of the argument lists.

  • It enhances ConVal to inclue a boolean for work-free-ness, so that the envt can contain non-work-free constructor applications, so that we can do more: see Note [ConVal work-free-ness]

  • It rejigs subsumePats so that it doesn't reverse the list. This can make a difference because, when patterns overlap, we arbitrarily pick the first. There is no "right" way, but this retains the old pre-subsumePats behaviour, thereby "fixing" the regression in #24282 (closed).

Edited by Simon Peyton Jones

Merge request reports