WorkWrap: Absent fillers should not be regarded as HNF, but as diverging
In #19595 (comment 341956), @simonpj writes:
I think it's the case that
Note [aBSENT_ERROR_ID]is now solving a non-problem. Consider the problematic case of that Note:
data T a = MkT a !a g :: Int -> T a -> a g 0 (MkT p q) = p g n t = g (n-1) t f True x = case x of MkT a b -> g 20 (MkT b a) f False x = f True xIn the old demand analyser,
fhas an absent demand on the first component of itsxargument. But in the new demand analyser the demand is1A, which is not entirely absent, and when we w/w f we pass that argument along. So I think the entire issue has gone away and we can remove all the special pleading aroundabsentError. Do you agree? Would you like to try? It'd be a good simplification.
By "removing the special pleading", Simon refers to the changes to exprIsHNF in dbbee1ba, where absentError is regarded as an HNF. The solution is to
- Revert part of dbbee1ba, removing the
exprIsHNFbits - Making absent errors have proper bottoming strictness signatures, as they used to have.
- Introduce some special handling for LitRubbish (in the ball park of SPJ), in particular the Simplifier should discard its continuations. Should we also make it have
botDiv/botCPR? Unclear... After all, we put them in strict fields and it would be weird to have a (according to strcitness analysis) bottoming value in a strict field. So I'd rather say we give it special treatment in the Simplifier but nothing more.
Edited by Sebastian Graf