X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fprelude%2FPrelRules.lhs;h=8bdaeb36aa1f0bba7ae7ba1ccccfbd3b2e724f23;hb=1525a5819aa3a6eae8d8b05cfe348a2384da0c84;hp=ae26f8484fd40dbc7e6824a05527e5a5ea3f01b5;hpb=f2dcf256399e9a2de6343c625630b51f8abf4863;p=ghc-hetmet.git diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index ae26f84..8bdaeb3 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -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