See the other comments about lambdas vs. lambda calculus, but lambdas are supposed to be for incredibly simple tasks that don’t need a full function definition, things that could be done in a line or two, like simple comparisons or calling another function. This is most useful for abstractions like list filtering, mapping, folding/reducing, etc. where you usually don’t need a very advanced function call.
I was always taught in classes that if your lambda needs more than just the return statement, it should probably be its own function.
See the other comments about lambdas vs. lambda calculus, but lambdas are supposed to be for incredibly simple tasks that don’t need a full function definition, things that could be done in a line or two, like simple comparisons or calling another function. This is most useful for abstractions like list filtering, mapping, folding/reducing, etc. where you usually don’t need a very advanced function call.
I was always taught in classes that if your lambda needs more than just the return statement, it should probably be its own function.