Question: So I'm extracting the lines that I want from this larger file using this program:

```
import csv

name = ['NAMETHEFIRST,' 'NAMEANOTHERNAME ']
data = csv.reader(open('C:\\bigfile.csv'))

with open('C:\\smalldataset.xcl','w') as outf:
    csv.writer(outf).writerows(l for l in data if l[0] in name)

```

The program runs. However I am only getting the line of data from `NAMETHEFIRST` and I get no data from `NAMETHEOTHERNAME` written to my small dataset file. This works exactly as I want printing all relevant info from the large data set of the line of data for NAME THE FIRST but i get no information from the second nametheother name written to the smaller file. Why isn't this working?

Answer: 
The result of the yield in the for comprehension is derived from the type of the first generator, in you method, you're constraining the types of your parameters so far you lose your :+ methods.

```
//The type of 1 to 9 is show below
scala> 1 to 9
res0: scala.collection.immutable.Range.Inclusive with scala.collection.immutable.Range.ByOne = Range(1, 2, 3, 4, 5, 6, 7, 8, 9)

//If you cast it to Iterable[Int] it doens't have the :+ method
scala> (res0:Iterable[Int]) :+ 1
<console>:7: error: value :+ is not a member of Iterable[Int]
       (res0:Iterable[Int]) :+ 1
       ^

//But if you don't, you have it
scala> res0 :+ 1                
res6: scala.collection.immutable.IndexedSeq[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 1)

//And to prove that for comprehensions yield derives the type of the first generator:

scala> for(a <- res0) yield a
res7: scala.collection.immutable.IndexedSeq[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9)

scala> for(a <- (res0:Iterable[Int])) yield a
res8: Iterable[Int] = Vector(1, 2, 3, 4, 5, 6, 7, 8, 9)

```
The compiler error occurs because `:+` is a member of `IndexedSeq` (and thus `List`) but not of `Iterable`. If you change the return value of `unitList` from

```
u1 :+ u2 :+ u3

```

to

```
List(u1) :+ u2 :+ u3

```

it compiles just fine.