When comparing Case expressions, take account of empty alternatives
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 16 May 2012 09:50:36 +0000 (10:50 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 16 May 2012 09:50:36 +0000 (10:50 +0100)
commitebcad7641a1e37e2e4abd7f513feb10c4ee458bc
treeed3cea3ec31c4853fc6e7ae31293ac07c882e566
parent6c3045b90fb28861fae826c8bbd53135d3f2a6ce
When comparing Case expressions, take account of empty alternatives

After the recent change that allows empty case alternatives, we
were accidentally saying that these two were equal:
   Case x _ Int  []
   Case x _ Bool []
Usually if the alternatives are equal so is the result type -- but
not if the alternatives are empty!

There are two places to fix:
  CoreUtils.eqExpr
  TrieMap with CoreExpr key

Fixes #6096, #6097
compiler/coreSyn/CoreUtils.lhs
compiler/coreSyn/TrieMap.lhs