标签: list haskell graph
我有一个图像:[("a","b"),("a","c"),("a","d"),("b","e"),("c","f"),("d","e"),("e","f"),("e","g"),("f","d")],我需要将其转换为:
[("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
任何人都可以帮助我吗?
由于
答案 0 :(得分:0)
由于这是作业,我只会给你一个提示:看看Data.List.groupBy。
Data.List.groupBy