function composition, iterators and function objects