title: Why design a language with unique anonymous types?
body: <p>This is something that has always been bugging me as a feature of C++ lambda expressions: The type of a C++ lambda expression is unique and anonymous, I simply cannot write it down. Even if I create two lambdas that are syntactically exactly the same, the resulting types are defined to be distinct. The consequence is, that a) lambdas can only be passed to template functions that allow the compile time, unspeakable type to be passed along with the object, and b) that lambdas are only useful once they are type erased via <code>std::function&lt;&gt;</code>.</p>
  <p>Ok, but that's just the way C++ does it, I was ready to write it off as just an irksome feature of that language. However, I just learned that Rust seemingly does the same: Each Rust function or lambda has a unique, anonymous type. And now I'm wondering: Why?</p>
  <p>So, my question is this:<br />
  <strong>What is the advantage, from a language designer point of view, to introduce the concept of a unique, anonymous type into a language?</strong></p>