Cumulative Learning in the Lambda Calculus