Converting generators into lambdas