implement foldRight using by-name parameter to enable early
termination.