[Git][ghc/ghc][wip/T23109a] Fix `augment`!

Simon Peyton Jones pushed to branch wip/T23109a at Glasgow Haskell Compiler / GHC Commits: 6cd9b8b6 by Simon Peyton Jones at 2025-04-22T17:47:48+01:00 Fix `augment`! - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Base.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Base.hs ===================================== @@ -1809,7 +1809,12 @@ build g = g (:) [] augment :: forall a. (forall b. (a->b->b) -> b -> b) -> [a] -> [a] {-# INLINE [1] augment #-} -augment g = g (:) +-- Give it one argument so that it inlines with one arg +-- But (crucially) the body is a lambda so that `g` is visibly applied +-- to two args, and hence we know that in a call +-- augment (\c n. blah) +-- both c and n are OneShot +augment g = \xs -> g (:) xs {-# RULES "fold/build" forall k z (g::forall b. (a->b->b) -> b -> b) . View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6cd9b8b6ad68d904df353c9ba298d123... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6cd9b8b6ad68d904df353c9ba298d123... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)