【发布时间】:2016-07-31 14:44:27
【问题描述】:
我正在尝试将一个元组列表映射到另一个元组列表,但没有成功。
示例输入:
a = [("eo","th"),("or","he")]
示例输出:
[('e','t'),('o','h'),('o','h'),('r','e')]
我试过了:
map (\(a,b) -> (a!!0,b!!0):(a!!1,b!!1):[]) a
但它会产生:
[[('e','t'),('o','h')],[('o','h'),('r','e')]]
【问题讨论】:
标签: list haskell dictionary tuples