Question: I'd like to convert a list of tuples `(a,a)` into just a list of `a`s. This is what i have so far

```
map (\(x,y) -> [x,y]) [(1,4),(2,5)] 
> [[1,4],[2,5]]

```

but what i want is

```
> [1,4,2,5]

```

Answer: 
The only extra step you need to take is to **`concat`enate the lists**, with:

```
concat (map (\(x,y) -> [x,y]) [(1,4),(2,5)])

```

here [**`concat :: [[a]] -> [a]`**](http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html#v:concat) thus concatenates the list of lists together into a single list.

Since such constructions occur often, there is a function that makes it more convenient: [**`concatMap :: (a -> [b]) -> [a] -> [b]`**](http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html#v:concatMap):

```
concatMap (\(x,y) -> [x,y]) [(1,4),(2,5)]

```

You can also use [**list comprehension**](https://wiki.haskell.org/List_comprehension), and write it like:

```
[z | (x,y) <- items, z <- [x,y]]

```

where `data` is your list of initial data.
What you are describing is a common Haskell pattern!

1. Take a list
2. Use a function that generates lists for each element
3. Join into a single list.

It doesn't have to be a list,

1. Take a container
2. Use a function that generates a new container for each element
3. Join the containers.

For the list case, this function's type would be

```
[a] -> (a -> [a]) -> [a]

```

Let's call a container of `a`'s `m a`, where `m` is the container type. In this case, we would have

```
m a -> (a -> m a) -> m a

```

This function is `>>=`! We use it as an infix operator.

```
Prelude> [(1,4),(2,5)] >>= \(x,y) -> [x,y]
[1,4,2,5]

```

... where the container has to support "collapsing" two layers into one layer. This is a monad :)

`a >>= f` is the same as `concatMap f a`, as suggested by Willem Van Onsem.