Scanning for a collision #
Main results #
List.foldl_replaceOnCollision: repeatedly replacing a candidate by one fixed value when it equals a list entry is a single membership test. No freshness premise is needed.
A scan returns p when the original candidate collides, and retains the candidate
otherwise. Once replaced, the value stays p.