An exercise in function composition