Class GroupBy<K,V>
java.lang.Object
com.jnape.palatable.lambda.functions.builtin.fn2.GroupBy<K,V>
- Type Parameters:
K
- the Map key typeV
- the Map value type
- All Implemented Interfaces:
Fn1<Fn1<? super V,
,? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>> Fn2<Fn1<? super V,
,? extends K>, Iterable<V>, Map<K, List<V>>> Applicative<Fn1<Iterable<V>,
,Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>> Cartesian<Fn1<? super V,
,? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<?, ?>> Cocartesian<Fn1<? super V,
,? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<?, ?>> Contravariant<Fn1<? super V,
,? extends K>, Profunctor<?, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<?, ?>>> Functor<Fn1<Iterable<V>,
,Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>> Profunctor<Fn1<? super V,
,? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<?, ?>> Monad<Fn1<Iterable<V>,
,Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>> MonadReader<Fn1<? super V,
,? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>> MonadRec<Fn1<Iterable<V>,
,Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>> MonadWriter<Fn1<? super V,
? extends K>, Fn1<Iterable<V>, Map<K, List<V>>>, Fn1<Fn1<? super V, ? extends K>, ?>>
public final class GroupBy<K,V>
extends Object
implements Fn2<Fn1<? super V,? extends K>,Iterable<V>,Map<K,List<V>>>
Given an
Iterable<V>
vs
and a key function V -> K
f
,
fold vs
into a Map<K, List<V>>
by applying f
to each element of
vs
, retaining values that map to the same key in a list, in the order they were iterated in.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip