Try c = zip a b<br><br><div class="gmail_quote">On Tue, Jun 9, 2009 at 9:05 AM, ptrash <span dir="ltr"><<a href="mailto:ptrash@web.de">ptrash@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi,<br>
<br>
I have the following two lists:<br>
<br>
a = [1,2,3]<br>
b = ["A","B","C"]<br>
<br>
I want a combination of the to lists:<br>
<br>
c = [(1,"A"), (2, "B"), (3, "C")]<br>
<br>
How can I do this?<br>
<br>
I have tried<br>
<br>
c = [(x,y) | x <- a, y <- b]<br>
<br>
But this just returns me a list with every possible combination of the 2<br>
lists.<br>
<br>
Thanks...<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://www.nabble.com/Combine-to-List-to-a-new-List-tp23942440p23942440.html" target="_blank">http://www.nabble.com/Combine-to-List-to-a-new-List-tp23942440p23942440.html</a><br>
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br>