Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • libraries/base/changelog.md
    ... ... @@ -26,6 +26,7 @@
    26 26
       * Expose constructor and field of `Backtraces` from `Control.Exception.Backtrace`, as per [CLC #199](https://github.com/haskell/core-libraries-committee/issues/199#issuecomment-1954662391)
    
    27 27
     
    
    28 28
       * Fix incorrect results of `integerPowMod` when the base is 0 and the exponent is negative, and `integerRecipMod` when the modulus is zero ([#26017](https://gitlab.haskell.org/ghc/ghc/-/issues/26017)).
    
    29
    +  * Fix the rewrite rule for `scanl'` not being strict in the first element of the output list ([#26143](https://gitlab.haskell.org/ghc/ghc/-/issues/26143)).
    
    29 30
     
    
    30 31
     
    
    31 32
     ## 4.21.0.0 *December 2024*
    

  • libraries/ghc-internal/src/GHC/Internal/List.hs
    ... ... @@ -601,7 +601,7 @@ scanl' = scanlGo'
    601 601
     -- See Note [scanl rewrite rules]
    
    602 602
     {-# RULES
    
    603 603
     "scanl'"  [~1] forall f a bs . scanl' f a bs =
    
    604
    -  build (\c n -> a `c` foldr (scanlFB' f c) (flipSeq n) bs a)
    
    604
    +  build (\c n -> a `seq` (a `c` foldr (scanlFB' f c) (flipSeq n) bs a))
    
    605 605
     "scanlList'" [1] forall f a bs .
    
    606 606
         foldr (scanlFB' f (:)) (flipSeq []) bs a = tail (scanl' f a bs)
    
    607 607
      #-}