Skip to content
  • Simon Peyton Jones's avatar
    Improve Simplifier and SpecConstr behaviour · 70ad6e6a
    Simon Peyton Jones authored
    Trac #4908 identified a case where SpecConstr wasn't "seeing" a
    specialisation it should easily get.  The solution was simple: see
    Note [Add scrutinee to ValueEnv too] in SpecConstr.
    
    Then it turned out that there was an exactly analogous infelicity in
    the mighty Simplifer too; see Note [Add unfolding for scrutinee] in
    Simplify. This fix is good for Simplify even in the absence of the
    SpecConstr change.  (It arose when I moved the binder- swap stuff to
    OccAnall, not realising that it *remains* valuable to record info
    about the scrutinee of a case expression.  The Note says why.
    
    Together these two changes are unconditionally good.  Better
    simplification, better specialisation. Thank you Max.
    70ad6e6a