While this works, I think it creates unnecessary indirection, since in effect we're just returning the lambda and calling it immediately. There doesn't seem to be a benefit from making this a higher-order function.