isImplicitId, isDeadBinder, isDictId, isStrictId,
isExportedId, isLocalId, isGlobalId,
isRecordSelector, isNaughtyRecordSelector,
- isClassOpId_maybe, isDFunId,
+ isClassOpId_maybe, isDFunId, dfunNSilent,
isPrimOpId, isPrimOpId_maybe,
isFCallId, isFCallId_maybe,
isDataConWorkId, isDataConWorkId_maybe, isDataConId_maybe, idDataCon,
-- Make an with the same unique and type as the
-- incoming Id, but with an *Internal* Name and *LocalId* flavour
localiseId id
- | isLocalId id && isInternalName name
+ | ASSERT( isId id ) isLocalId id && isInternalName name
= id
| otherwise
= mkLocalIdWithInfo (localiseName name) (idType id) (idInfo id)
_ -> False
isDFunId id = case Var.idDetails id of
- DFunId _ -> True
- _ -> False
+ DFunId {} -> True
+ _ -> False
+
+dfunNSilent :: Id -> Int
+dfunNSilent id = case Var.idDetails id of
+ DFunId ns _ -> ns
+ _ -> pprTrace "dfunSilent: not a dfun:" (ppr id) 0
isPrimOpId_maybe id = case Var.idDetails id of
PrimOpId op -> Just op