Scala - Confusion with lambda in map function
<p>I am learning Scala and was experimenting in the command line. I am not able to understand why the second line fails to compile. Can someone please explain.</p>

<pre><code>val list = List(1,2,3,4)
list.map(_+1)           //This works. List(2,3,4,5)
list.map(List(_+1))     //But, Compilation Fails here
list.map(x=&gt;List(x+1))  //This works. List(List(2),List(3),List(4),List(5))
</code></pre>

<p>Thank you.</p>