Skip to content

Commit

Permalink
Eta-expand Builder.Internal.empty (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
clyring authored Sep 27, 2023
1 parent 2e2e5ca commit 750dac3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Data/ByteString/Builder/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,14 @@ runBuilderWith (Builder b) = b
-- only exported for use in rewriting rules. Use 'mempty' otherwise.
{-# INLINE[1] empty #-}
empty :: Builder
empty = Builder ($)
empty = Builder (\k br -> k br)
-- This eta expansion (hopefully) allows GHC to worker-wrapper the
-- 'BufferRange' in the 'empty' base case of loops (since
-- worker-wrapper requires (TODO: verify this) that all paths match
-- against the wrapped argument.
--
-- Do not use ($), which has arity 1 since base-4.19.
-- See also https://gitlab.haskell.org/ghc/ghc/-/issues/23822

-- | Concatenate two 'Builder's. This function is only exported for use in rewriting
-- rules. Use 'mappend' otherwise.
Expand Down

0 comments on commit 750dac3

Please sign in to comment.