TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2016 |
Maintained by William Zang.
ZLazyList is just a functional programming test. To show what is lazily calculate.
To run the example project, clone the repo, and run pod install
from the Example directory first.
You can create a list like this:
ZLazyList *list1 = [[ZLazyList alloc] initWithArray:@[@1, @2, @3]];
Then use filter:
or map:
add to this list
ZLazyList *list2 = [list1 map:^id(NSNumber *value) {
return @(value.integerValue * 2);
}];
NSLog(@"%@", list2[2]);
You will found the map block is only be call once.
ZLazyList is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "ZLazyList"
臧成威, [email protected]
ZLazyList is available under the MIT license. See the LICENSE file for more info.