Small refactor in desugar of pattern matching
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 27 Jul 2018 08:17:20 +0000 (09:17 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 27 Jul 2018 09:06:14 +0000 (10:06 +0100)
commit45cfe6514afb47c26883687e25ff7eb1e40c5a52
treedfc1b3b3e117d055436de8a632434c3ad071acdc
parentf265008fb6f70830e7e92ce563f6d83833cef071
Small refactor in desugar of pattern matching

In reviewing Phab:D4968 for Trac #15385 I saw a small
but simple refactor to avoid unnecessary work in the
desugarer.

This patch just arranges to call
   matchSinglePatVar v ...
rather than
   matchSinglePat (Var v) ...

The more specialised function already existed, as
   match_single_pat_var

I also added more comments about decideBangHood
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsListComp.hs
compiler/deSugar/DsMonad.hs
compiler/deSugar/DsUtils.hs
compiler/deSugar/Match.hs