I've been doing more functional programming recently, and realised just how general a for loop is. We needed a function `int list -> (bool, int) list` that would mark each item if it was the largest seen so far. Pretty straightforward.