[commit: ghc] wip/cheap-build-osa1: Use cheapBuild for enumerating Ints (5e6b43c)

git at git.haskell.org git at git.haskell.org
Wed Feb 21 06:50:27 UTC 2018


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

On branch  : wip/cheap-build-osa1
Link       : http://ghc.haskell.org/trac/ghc/changeset/5e6b43c79115a06a49ec3076208138c421177497/ghc

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

commit 5e6b43c79115a06a49ec3076208138c421177497
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Aug 4 09:09:13 2015 +0200

    Use cheapBuild for enumerating Ints


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

5e6b43c79115a06a49ec3076208138c421177497
 libraries/base/GHC/Enum.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/base/GHC/Enum.hs b/libraries/base/GHC/Enum.hs
index e2655c9..1df43b0 100644
--- a/libraries/base/GHC/Enum.hs
+++ b/libraries/base/GHC/Enum.hs
@@ -455,7 +455,7 @@ instance  Enum Int  where
 -- In particular, we have rules for deforestation
 
 {-# RULES
-"eftInt"        [~1] forall x y. eftInt x y = build (\ c n -> eftIntFB c n x y)
+"eftInt"        [~1] forall x y. eftInt x y = cheapBuild (\ c n -> eftIntFB c n x y)
 "eftIntList"    [1] eftIntFB  (:) [] = eftInt
  #-}
 
@@ -497,7 +497,7 @@ eftIntFB c n x0 y | isTrue# (x0 ># y) = n
 -- See Note [How the Enum rules work]
 {-# RULES
 "efdtInt"       [~1] forall x1 x2 y.
-                     efdtInt x1 x2 y = build (\ c n -> efdtIntFB c n x1 x2 y)
+                     efdtInt x1 x2 y = cheapBuild (\ c n -> efdtIntFB c n x1 x2 y)
 "efdtIntUpList" [1]  efdtIntFB (:) [] = efdtInt
  #-}
 



More information about the ghc-commits mailing list