Skip to content
  • Simon Peyton Jones's avatar
    Fix the implementation of lazyId · 4c3a0a4a
    Simon Peyton Jones authored
    'lazy' was doing part of its job, but not all!  In particular,
    an application
      f (lazy e)
    where f is strict, was still being compiled using call-by-value in
    CorePrep.  This defeated the purpose of defining catch as
       catch a b = catch# (lazy a) b
    See Trac #11555, and Neil Mitchell's test case in comment:14
    
    This patch makes 'lazy' behave properly. I updated Note [lazyId magic]
    in MkId, but all the action is in CorePrep.
    
    I can't say I really like this, but it does the job.
    4c3a0a4a