idNewStrictness, idNewStrictness_maybe,
idWorkerInfo,
idUnfolding,
- idSpecialisation, idCoreRules,
+ idSpecialisation, idCoreRules, idHasRules,
idCafInfo,
idLBVarInfo,
idOccInfo,
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
isOneShotBndr :: Id -> Bool
-- This one is the "business end", called externally.
-- Its main purpose is to encapsulate the Horrible State Hack
-isOneShotBndr id = isOneShotLambda id || (isStateHackType (idType id))
+isOneShotBndr id = isOneShotLambda id || isStateHackType (idType id)
isStateHackType :: Type -> Bool
isStateHackType ty