Arity analysis sometimes needs two iterations
Since !4207 (closed), we have seen an increase in "Exciting arity" warnings originating from the arity analyser.
But annoyingly, I found (!4334 (comment 308669)) that there are still cases remaining where we emit the warning, for example:
f :: [Int] -> Int -> Int f  = id f (x:xs) = let y = sum [0..x] in \z -> f xs (y + z)
Fixed-point iteration starts with arity type
After the first iteration, we get arity type
\??.T, e.g. arity 2, because we unconditionally
floatIn the let-binding although it is not cheap. We are allowed to do so, because the arity type of the lambda body is bottoming.
After the second iteration, we get arity type
\?.T, e.g. arity 1, because now we aren't allowed to
floatIn the non-cheap let-binding.
Which is all perfectly benign, but means we do two iterations instead of just one and emit the warning.
I don't see a good way out, other than triggering the warning on the third (and following) iteration only.