1. 08 May, 2022 2 commits
  2. 06 May, 2022 8 commits
  3. 05 May, 2022 10 commits
  4. 04 May, 2022 13 commits
  5. 03 May, 2022 1 commit
    • Sebastian Graf's avatar
      Assume at least one evaluation for nested SubDemands (#21081, #21133) · 15ffe2b0
      Sebastian Graf authored
      See the new `Note [SubDemand denotes at least one evaluation]`.
      
      A demand `n :* sd` on a let binder `x=e` now means
      
      > "`x` was evaluated `n` times and in any program trace it is evaluated, `e` is
      >  evaluated deeply in sub-demand `sd`."
      
      The "any time it is evaluated" premise is what this patch adds. As a result,
      we get better nested strictness. For example (T21081)
      ```hs
      f :: (Bool, Bool) -> (Bool, Bool)
      f pr = (case pr of (a,b) -> a /= b, True)
      -- before: <MP(L,L)>
      -- after:  <MP(SL,SL)>
      
      g :: Int -> (Bool, Bool)
      g x = let y = let z = odd x in (z,z) in f y
      ```
      The change in demand signature "before" to "after" allows us to case-bind `z`
      here.
      
      Similarly good things happen for the `sd` in call sub-demands `Cn(sd)`, which
      allows for more eta-reduction (which is only sound with `-fno-pedantic-bottoms`,
      albeit).
      
      We also fix #21085, a surprising inconsistency with `Poly` to `Call` sub-demand
      expansion.
      
      In an attempt to fix a regression ...
      15ffe2b0
  6. 02 May, 2022 6 commits