Add idHasRules
[ghc-hetmet.git] / compiler / basicTypes / Id.lhs
index c7ce818..8f955d3 100644 (file)
@@ -66,7 +66,7 @@ module Id (
        idNewStrictness, idNewStrictness_maybe, 
        idWorkerInfo,
        idUnfolding,
-       idSpecialisation, idCoreRules,
+       idSpecialisation, idCoreRules, idHasRules,
        idCafInfo,
        idLBVarInfo,
        idOccInfo,
@@ -409,6 +409,9 @@ idSpecialisation id = specInfo (idInfo id)
 idCoreRules :: Id -> [CoreRule]
 idCoreRules id = specInfoRules (idSpecialisation id)
 
+idHasRules :: Id -> Bool
+idHasRules id = not (isEmptySpecInfo (idSpecialisation id))
+
 setIdSpecialisation :: Id -> SpecInfo -> Id
 setIdSpecialisation id spec_info = modifyIdInfo (`setSpecInfo` spec_info) id