distinct

Group the items in the collection based on the value returned by the lambda argument. groupBy can be applied on a list< T >, or set< T >.

Parameters:

No. Type Comments
1 list< T > or set< T > The object on which the groupBy should be applied
2 A lambda that accepts 1 parameter Accepts an element of the collection and returns the value to group by

Returns:

A map keyed by the results of the lambda and values as a list of element types. Usages:

  • groupBy( v:list<T>, e => result : R ) : map< R, list<T> >
  • groupBy( v:set<T>, e => result : R ) : map< R, list<T> >