Lab 06 - Exercise 6, Infinite List
Exercise 6 Review
1
2
3
public <U> Lazy<U> map(Transformer<? super T, ? extends U> f) {
U result = f.transform(this.get());
return Lazy.of(() -> result);
}
// No Longer Lazy because this.get() is expensivepublic <U> Lazy<U> map(Transformer<? super T, ? extends U> f) {
return Lazy.of(() -> f.transform(this.get()));
}Keys of being lazy
Infinite List
Mathematical Context
List Creation
PreviousLab 05 - Factory Method, Option, Lazy EvaluationNextLab 08 - Exercise 7, Asynchronous Programming
Last updated