There's two ways to interpret this question. The first is why write map (\x -> x * x)
when we can write
doubleIt x = x * x
... map doubleIt ...
The answer there is that you may have the following:
foo y zs = map (\x -> x^y) zs
and then there is no fully straightfoward transformation that allows you to float the anonymous function fully to the top level.
We could write
foo y zs = map (powerIt y) xs
powerIt y = ?
and then we discover that powerIt y = \x -> x^y
! (sure, you could float the x back to the outer definition, but in that case, you'd actually want to (although syntactically Haskell doesn't make you) write (powerIt y)
as (\x -> powerIt y x)
.
When you have first class functions, they need to close over their environment, and that means that you need some way to introduce a function which can refer to things in the lexical scope where it is declared. That's the power of lambdas!
Now, the other question is why not float the anonymous functions to the appropriate level that's not the top and thus get, e.g.
foo y zs = let powerIt x = x^z
in map powerIt zs
In that case, think carefully about what let really means again. In fact, we can transform the let into a few lambdas in the following way: foo ys zs = (\powerIt -> map powerIt zs) (\x -> x^y)
Now, in real implementations, these desugarings don't all happen exactly this way, and sometimes different clauses get treated differently by compilers for reasons involving efficiency. But the core thing remains -- lambdas are very powerful and expessive, and can give us a core language that is simple and easy to reason about despite the variety of binding forms that we layer on top of them.
Without lambdas we have a language where we can define variables and we can define functions and then we can sometimes do certain things with functions. With lambdas we have a language where functions are values just like any other value, and we have one set of uniform ways to assign names to anything.
The inversion of perspective is to see lambdas not as a special-case, but as the general case, and all our other various name binding mechanisms as sugar for them.