[commit: ghc] wip/cheap-build: Use cheapBuild for enumerating Ints (8ec51e4)
git at git.haskell.org
git at git.haskell.org
Thu Mar 16 17:21:03 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/cheap-build
Link : http://ghc.haskell.org/trac/ghc/changeset/8ec51e481fba2e053cb3eec33c1695cdb4a36f2c/ghc
>---------------------------------------------------------------
commit 8ec51e481fba2e053cb3eec33c1695cdb4a36f2c
Author: Ben Gamari <ben at smart-cactus.org>
Date: Tue Aug 4 09:09:13 2015 +0200
Use cheapBuild for enumerating Ints
>---------------------------------------------------------------
8ec51e481fba2e053cb3eec33c1695cdb4a36f2c
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