Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个类似的图表:[("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
谁能帮我?
谢谢
由于这是作业,我只给你一个提示:看看Data.List.groupBy.
Data.List.groupBy