robb / Asterism

Asterism is yet another functional toolbelt for Objective-C. It tries to be typesafe and simple.
http://robb.github.io/Asterism/
MIT License
226 stars 12 forks source link

Add support for NSCountedSet #49

Open robb opened 10 years ago

robb commented 10 years ago

This one is a little more tricky since NSCountedSet inherits from NSMutableSet.

Since we would want ASTMap(countedSet, block); to be equivalent to ASTMap((NSSet *)countedSet, block);, "unrolling" versions of map et. al. would need an extra parameter.

E.g.:

// if unroll is YES, calls the block multiple times per element.
NSCountedSet *ASTMap(NSCountedSet *set, BOOL unroll, id(^block)(id obj));