Myke
Myke

Reputation: 281

How can I merge list of three lists in one list using haskell

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?

Upvotes: 1

Views: 229

Answers (2)

Godstime Osarobo
Godstime Osarobo

Reputation: 194

You could also do [1,2] ++ [3,4] ++ [5,6]

Upvotes: 1

Ry-
Ry-

Reputation: 225281

concat will do that!

> concat [[1,2],[3,4],[5,6]]
[1,2,3,4,5,6]

Upvotes: 5

Related Questions