[Haskell-cafe] Combine to List to a new List
moonlite at dtek.chalmers.se
Tue Jun 9 09:39:30 EDT 2009
On Tue, 2009-06-09 at 06:05 -0700, ptrash wrote:
> I have the following two lists:
> a = [1,2,3]
> b = ["A","B","C"]
> I want a combination of the to lists:
> c = [(1,"A"), (2, "B"), (3, "C")]
> How can I do this?
What you want is a function with the following type signature:
[t1] -> [t2] -> [(t1,t2)]
Search for that in hoogle and you get the function "zip" as a
result (as already told in this thread).
Hoogle is your friend (and helps you help yourself)! :)
More information about the Haskell-Cafe