[commit: ghc] master: Make getTag use a bang pattern instead of seq (dc5fa80)

git at git.haskell.org git at git.haskell.org
Fri Nov 7 13:19:47 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/dc5fa804c604fa73494d97f1f1b0fef649731481/ghc

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

commit dc5fa804c604fa73494d97f1f1b0fef649731481
Author: David Feuer <David.Feuer at gmail.com>
Date:   Fri Nov 7 14:19:18 2014 +0100

    Make getTag use a bang pattern instead of seq
    
    It's prettier that way, and there's less risk of anything
    going sideways.
    
    Reviewed By: hvr, simonpj
    
    Differential Revision: https://phabricator.haskell.org/D450


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

dc5fa804c604fa73494d97f1f1b0fef649731481
 libraries/base/GHC/Base.lhs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/base/GHC/Base.lhs b/libraries/base/GHC/Base.lhs
index 495a6b2..217f6ad 100644
--- a/libraries/base/GHC/Base.lhs
+++ b/libraries/base/GHC/Base.lhs
@@ -1121,7 +1121,7 @@ in the case when the argument is already known to be evaluated.
 \begin{code}
 {-# INLINE getTag #-}
 getTag :: a -> Int#
-getTag x = x `seq` dataToTag# x
+getTag !x = dataToTag# x
 \end{code}
 
 %*********************************************************



More information about the ghc-commits mailing list