pivotal/PivotalCoreKit — pull request #104 by pjk25 (2014-12-04 06:20:41+00:00)
Title: -[NSArray reduce:], -[NSArray filter:] & block composition helpers

Add reduce, map and filter methods to the NSArray extensions, and delegate the existing collect methods to those implementations.

Introduce PCKOption, PCKError, and PCKCompletionHandler "Monads". These classes allow one to compose, assign, and call blocks associated with these types. For example, a block associated with the Option Monad receives a non-nil value, and returns a potentially nil value. If blocks of this type are composed with these helpers, the call chain stops once a nil is produced. The Error Monad allows one to safely compose error producing operations, and the CompletionHandler Monad allows one to safely compose blocks matching the completionHandler of an NSURLSession or NSURLConnection request.