Fix Trac #246: order of matching in record patterns
authorsimonpj@microsoft.com <unknown>
Mon, 30 Mar 2009 08:37:36 +0000 (08:37 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 30 Mar 2009 08:37:36 +0000 (08:37 +0000)
commit54e6de853bd5260389006e75d661877ef1ea951d
tree9f5d09d300923855714fa25775f5455208572046
parent4da93ad236882128b7b446e83a2c159ef17d7ffa
Fix Trac #246: order of matching in record patterns

While I was looking at the desugaring of pattern matching (fixing
Trac #3126) I finally got around to fixing another long-standing bug:
when matching in a record pattern, GHC should match left-to-right in
the programmer-specfied order, *not* left-to-right positionally in
the original record declaration.

Needless to say, that requires a little more code.
See Note [Record patterns] in MatchCon.lhs
compiler/deSugar/MatchCon.lhs