Sep. 17th, 2008
set of pairs to map conversion
Sep. 17th, 2008 08:06 pmAll details are here
Categorical approach does change programming style... Everything's lazy here.
where
( Read more... )
Categorical approach does change programming style... Everything's lazy here.
public static <X, Y> Map<X, Y> Map(final Set<Pair<X, Y>> pairs) {
final Function<Pair<X, Y>, Map.Entry<X, Y>> idmap = Function.id();
return new AbstractMap<X, Y>() {
public Set<Entry<X, Y>> entrySet() {
return idmap.map(pairs);
}
};
}
where
( Read more... )