NSSet+OCTotallyLazy.h 490 B

123456789101112131415161718192021
  1. #import <Foundation/Foundation.h>
  2. #import "Some.h"
  3. #import "None.h"
  4. #import "Sequence.h"
  5. @interface NSSet (Functional) <Mappable, Foldable, Enumerable>
  6. - (Option *)find:(PREDICATE)filterBlock;
  7. - (NSSet *)filter:(PREDICATE)filterBlock;
  8. - (NSSet *)groupBy:(FUNCTION1)groupingBlock;
  9. - (id)head;
  10. - (Option *)headOption;
  11. - (NSSet *)join:(NSSet *)toJoin;
  12. - (id)reduce:(FUNCTION2)functorBlock;
  13. - (Sequence *)asSequence;
  14. - (NSArray *)asArray;
  15. @end
  16. static NSSet *set() {
  17. return [NSSet set];
  18. }