zapLamIdInfo, zapDemandIdInfo, zapFragileIdInfo,
-- Predicates
- isImplicitId, isDeadBinder, isDictId,
+ isImplicitId, isDeadBinder, isDictId, isStrictId,
isExportedId, isLocalId, isGlobalId,
isRecordSelector, isNaughtyRecordSelector,
isClassOpId_maybe,
isFCallId, isFCallId_maybe,
isDataConWorkId, isDataConWorkId_maybe, isDataConId_maybe, idDataCon,
isBottomingId, idIsFrom,
+ isTickBoxOp, isTickBoxOp_maybe,
hasNoBinding,
-- Inline pragma stuff
| otherwise = False -- TyVars count as not dead
\end{code}
+\begin{code}
+isTickBoxOp :: Id -> Bool
+isTickBoxOp id =
+ case globalIdDetails id of
+ TickBoxOpId tick -> True
+ _ -> False
+
+isTickBoxOp_maybe :: Id -> Maybe TickBoxOp
+isTickBoxOp_maybe id =
+ case globalIdDetails id of
+ TickBoxOpId tick -> Just tick
+ _ -> Nothing
+\end{code}
%************************************************************************
%* *
zapIdNewStrictness :: Id -> Id
zapIdNewStrictness id = modifyIdInfo (`setNewStrictnessInfo` Nothing) id
+\end{code}
+
+This predicate says whether the id has a strict demand placed on it or
+has a type such that it can always be evaluated strictly (e.g., an
+unlifted type, but see the comment for isStrictType). We need to
+check separately whether <id> has a so-called "strict type" because if
+the demand for <id> hasn't been computed yet but <id> has a strict
+type, we still want (isStrictId <id>) to be True.
+\begin{code}
+isStrictId :: Id -> Bool
+isStrictId id
+ = ASSERT2( isId id, text "isStrictId: not an id: " <+> ppr id )
+ (isStrictDmd (idNewDemandInfo id)) ||
+ (isStrictType (idType id))
---------------------------------
-- WORKER ID