ZLazyList 0.1.0

ZLazyList 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jul 2016

Maintained by William Zang.



ZLazyList 0.1.0

  • By
  • WilliamZang

ZLazyList is just a functional programming test. To show what is lazily calculate.

Example

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.

Installation

ZLazyList is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ZLazyList"

Author

臧成威, [email protected]

License

ZLazyList is available under the MIT license. See the LICENSE file for more info.