• simonpj@microsoft.com's avatar
    Improve the treatment of 'seq' (Trac #2273) · 4e36a8b1
    simonpj@microsoft.com authored
    Trac #2273 showed a case in which 'seq' didn't cure the space leak
    it was supposed to.  This patch does two things to help
    
    a) It removes a now-redundant special case in Simplify, which
       switched off the case-binder-swap in the early stages.  This
       isn't necessary any more because FloatOut has improved since
       the Simplify code was written.  And switching off the binder-swap
       is harmful for seq.
    
    However fix (a) is a bit fragile, so I did (b) too:
    
    b) Desugar 'seq' specially.  See Note [Desugaring seq (2)] in DsUtils
       This isn't very robust either, since it's defeated by abstraction, 
       but that's not something GHC can fix; the programmer should use
       a let! instead.
    4e36a8b1
DsUtils.lhs 37 KB