如何在haskell中连接两个列表

Nus*_*rat 1 haskell

我有两个清单x = ["a","b","c"]y = ["Argentina","Brazil","Canada"].我想要一个列表列表[["a","Argentina"],["b","Brazil"],["c","Canada"]].谁能帮帮我吗?谢谢.

Tom*_*lis 8

在没有看到你的用例的情况下我会猜测元组实际上足够了,并且更安全,因此这只是 zip

x = ["a","b","c"]
y = ["Argentina","Brazil","Canada"]
z = zip x y

Prelude> z
[("a","Argentina"),("b","Brazil"),("c","Canada")]
Run Code Online (Sandbox Code Playgroud)