Haskell equivalent to Scala's groupBy

后端 未结 7 1806
孤街浪徒
孤街浪徒 2021-02-02 12:29

Scala has a function groupBy on lists that accepts a function for extracting keys from list items, and returns another list where the items are tuples consisting of

7条回答
  •  一整个雨季
    2021-02-02 12:55

    This isn't a function in the List library.

    You can write it as the composition of sortBy and groupBy.

提交回复
热议问题