[commit: packages/bytestring] master: Eta expand continuation of empty (9b63d5f)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:43:56 UTC 2015


Repository : ssh://git@git.haskell.org/bytestring

On branch  : master
Link       : http://git.haskell.org/packages/bytestring.git/commitdiff/9b63d5f10f7a9f914c74c85539ab6389f12b5bcd

>---------------------------------------------------------------

commit 9b63d5f10f7a9f914c74c85539ab6389f12b5bcd
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Jan 15 11:54:21 2015 -0500

    Eta expand continuation of empty


>---------------------------------------------------------------

9b63d5f10f7a9f914c74c85539ab6389f12b5bcd
 Data/ByteString/Builder/Internal.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Data/ByteString/Builder/Internal.hs b/Data/ByteString/Builder/Internal.hs
index e8617ef..d52c626 100644
--- a/Data/ByteString/Builder/Internal.hs
+++ b/Data/ByteString/Builder/Internal.hs
@@ -385,7 +385,11 @@ runBuilderWith (Builder b) = b
 -- only exported for use in rewriting rules. Use 'mempty' otherwise.
 {-# INLINE[1] empty #-}
 empty :: Builder
-empty = Builder id
+empty = Builder (\cont -> (\range -> cont range))
+-- 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.
 
 -- | Concatenate two 'Builder's. This function is only exported for use in rewriting
 -- rules. Use 'mappend' otherwise.



More information about the ghc-commits mailing list