X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fprelude%2FPrelRules.lhs;h=f7a319873b41f40f1b0a4d3a6f9161f2cfe70267;hb=f80b81f8b56ebd0fa0f7f82494a5090e9ab64256;hp=ae26f8484fd40dbc7e6824a05527e5a5ea3f01b5;hpb=f2dcf256399e9a2de6343c625630b51f8abf4863;p=ghc-hetmet.git diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index ae26f84..f7a3198 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -20,7 +20,7 @@ module PrelRules ( primOpRules, builtinRules ) where #include "HsVersions.h" import CoreSyn -import Id ( mkWildId, isPrimOpId_maybe, idUnfolding ) +import Id ( mkWildId, idUnfolding ) import Literal ( Literal(..), mkMachInt, mkMachWord , literalType , word2IntLit, int2WordLit @@ -30,7 +30,7 @@ import Literal ( Literal(..), mkMachInt, mkMachWord , float2IntLit, int2FloatLit, double2IntLit, int2DoubleLit , float2DoubleLit, double2FloatLit ) -import PrimOp ( PrimOp(..), primOpOcc ) +import PrimOp ( PrimOp(..), primOpOcc, tagToEnumKey ) import TysWiredIn ( boolTy, trueDataConId, falseDataConId ) import TyCon ( tyConDataCons_maybe, isEnumerationTyCon, isNewTyCon ) import DataCon ( dataConTag, dataConTyCon, dataConWorkId, fIRST_TAG ) @@ -386,7 +386,7 @@ For dataToTag#, we can reduce if either \begin{code} dataToTagRule [Type ty1, Var tag_to_enum `App` Type ty2 `App` tag] - | Just TagToEnumOp <- isPrimOpId_maybe tag_to_enum + | tag_to_enum `hasKey` tagToEnumKey , ty1 `coreEqType` ty2 = Just tag -- dataToTag (tagToEnum x) ==> x