summaryrefslogtreecommitdiff
path: root/compiler/prelude/PrelNames.hs
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-09-23 13:10:13 -0500
committerAustin Seipp <austin@well-typed.com>2015-09-23 13:11:04 -0500
commitcf90a1e14efb900f94a3824b242be1c38b16a563 (patch)
treeeeef9c818f20cee8b0f75083bdf2cb201f525449 /compiler/prelude/PrelNames.hs
parent939a7d6367501d43be73f4e41db7395af1194989 (diff)
downloadhaskell-cf90a1e14efb900f94a3824b242be1c38b16a563.tar.gz
Add constant-folding rule for Data.Bits.bit
This adds a constant-folding rule for `Integer`'s implementation of `bit` and fixes the `T8832` testcase. Fixes #8832. Reviewed By: simonpj, austin Differential Revision: https://phabricator.haskell.org/D1255 GHC Trac Issues: #8832
Diffstat (limited to 'compiler/prelude/PrelNames.hs')
-rw-r--r--compiler/prelude/PrelNames.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index a6eb834641..be6396cf21 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -308,7 +308,7 @@ basicKnownKeyNames
decodeDoubleIntegerName,
gcdIntegerName, lcmIntegerName,
andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
- shiftLIntegerName, shiftRIntegerName,
+ shiftLIntegerName, shiftRIntegerName, bitIntegerName,
-- Float/Double
rationalToFloatName,
@@ -939,7 +939,7 @@ integerTyConName, mkIntegerName, integerSDataConName,
decodeDoubleIntegerName,
gcdIntegerName, lcmIntegerName,
andIntegerName, orIntegerName, xorIntegerName, complementIntegerName,
- shiftLIntegerName, shiftRIntegerName :: Name
+ shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name
integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit n) integerSDataConKey
where n = case cIntegerLibraryType of
@@ -986,6 +986,7 @@ xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xor
complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey
shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey
shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey
+bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey
-- GHC.Real types and classes
rationalTyConName, ratioTyConName, ratioDataConName, realClassName,
@@ -1901,6 +1902,9 @@ typeSymbolTypeRepKey = mkPreludeMiscIdUnique 507
toDynIdKey :: Unique
toDynIdKey = mkPreludeMiscIdUnique 508
+bitIntegerIdKey :: Unique
+bitIntegerIdKey = mkPreludeMiscIdUnique 509
+
{-
************************************************************************
* *