0

我有一个类似的图表:[("a","b"),("a","c"),("a","d"),("b","e"),("c","f"),("d","e"),("e","f"),("e","g"),("f","d")]我需要将其转换为:

[("a",["b","c","d"]),("b",["e"]) ...]

因为它是一个大学项目我只能使用更高的功能和 Data.List

谁能帮我?

谢谢

4

1 回答 1

0

由于这是作业,我只给你一个提示:看看Data.List.groupBy.

于 2013-10-31T08:45:56.163 回答