Reputation: 281
So I have a list like [[1,2],[3,4],[5,6]] in haskell. How can I make it to [1,2,3,4,5,6]. Is there any built in function that can do this?
[[1,2],[3,4],[5,6]]
[1,2,3,4,5,6]
Upvotes: 1
Views: 229
Reputation: 194
You could also do [1,2] ++ [3,4] ++ [5,6]
[1,2] ++ [3,4] ++ [5,6]
Reputation: 225281
concat will do that!
concat
> concat [[1,2],[3,4],[5,6]] [1,2,3,4,5,6]
Upvotes: 5