Question: Related to [Tuple Unpacking in Map Operations](https://stackoverflow.com/questions/6905207/tuple-unpacking-in-map-operations), I don't understand why do we need a `case` (that looks like a partial function to me) to extract values from tuple, like that:

```
arrayOfTuples map {case (e1, e2) => e1.toString + e2}

```

Instead of extracting in the same way it works in `foldLeft`, for example

```
def sum(list: List[Int]): Int = list.foldLeft(0)((r,c) => r+c)

```

Anyway we don't specify the type of parameters in the first case, so why do we need the `case` statement?

Answer: 
Because in Scala function argument lists and tuples are not a unified concept as they are in Haskell and other functional languages. So a function:

```
(t: (Int, Int)) => ...

```

is not the same thing as a function:

```
(e1: Int, e2: Int) => ...

```

In the first case you can use pattern matching to extract the tuple elements, and that's always done using `case` syntax. Actually, the expression:

```
{case (e1, e2) => ...}

```

is shorthand for:

```
t => t match {case (e1, e2) => ...}

```

There has been some discussions about unifying tuples and function argument lists, but there are complications regarding Java overloading rules, and also default/named arguments. So, I think it's unlikely the concepts will ever be unified in Scala.
Lambda with one primitive parameter
===================================

With 

```
var listOfInt=(1 to 100).toList
listOfInt.foldRight(0)((current,acc)=>current+acc)

```

you have a lambda function operating on two parameter.

Lambda with one parameter of type tuple
=======================================

With

```
var listOfTuple=List((1,"a"),(2,"b"),(3," "))
listOfTuple.map(x => x._1.toString + x._2.toString)

```

you have a lambda function working on one parameter (of type `Tuple2[Int, String]`)

Both works fine with type inference.

Partial lambda with one parameter
=================================

With

```
listOfTuple.map{case (x,y) => x.toString + y.toString}

```

you have a lambda function, working with one parameter (of type `Tuple2[Int, String]`). This lambda function then uses `Tuple2.unapply` internally to decompose the one parameter in multiple values. This still works fine with type inference. The `case` is needed for the decomposition ("pattern matching") of the value.

This example is a little bit unintuitive, because unapply returns a Tuple as its result. In this special case there might indeed be a trick, so Scala uses the provided tuple directly. But I am not really aware of such a trick.

Update: Lambda function with currying
=====================================

Indeed there is a trick. With

```
import Function.tupled
listOfTuple map tupled{(x,y) => x.toString + y.toString}

```

you can directly work with the tuple. But of course this is really a trick: You provide a function operating on two parameters and not with a tuple. `tupled` then takes that function and changes it to a different function, operating on a tuple. This technique is also called [uncurrying](http://hackage.haskell.org/package/base-4.7.0.1/docs/Prelude.html#v:uncurry).

Remark:
=======

The `y.toString` is superfluous when `y` is already a string. This is not considered good style. I leave it in for the sake of the example. You should omit it in real code.