> For the complete documentation index, see [llms.txt](https://devon-miller.gitbook.io/test_private_book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devon-miller.gitbook.io/test_private_book/miscellaneous/recipe-changing-seqa-to-a.md).

# Recipe: Changing Seq\[A] to A

Sometimes you have an "external world" process that gives you a `Seq[A]` but you need to process the data one `A` at a time.

You can define a pipe (until it comes standard in the library) like:

```scala
val toA = pipe.lift { seq => Stream.chunk(Chunk.seq(seq)) }
```

then you can do:

```scala
yourSourceOfSeqA.through(toA).toVector
```

This is equivalant to the following and is shorter:

```scala
yourSourceOfSeqA.flatMap(Stream.emits)
```
