Small refactor in desugar of pattern matching
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 27 Jul 2018 08:17:20 +0000 (09:17 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 2 Aug 2018 00:54:51 +0000 (20:54 -0400)
commit42c51e2f39ce829fa4a380b604c9a7f5ea71d28d
tree307062c1c8ec801ed79b7b6977a960af57cc735b
parent59f38587d44efd00b10a6d98f6a7a1b22e87f13a
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

(cherry picked from commit 45cfe6514afb47c26883687e25ff7eb1e40c5a52)
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsListComp.hs
compiler/deSugar/DsMonad.hs
compiler/deSugar/DsUtils.hs
compiler/deSugar/Match.hs