HigherOrderKit is an attempt to bring common higher order functions to Objective-C, more specifically to Foundation framework classes.
Foundation framework already include higher order functions for some of its classes but they are little familiar with their equivalents in other languages, like Lisp, Haskell, JavaScript or Python to name a few.
Such functions include map, reduce (a.k.a. fold), select (a.k.a. filter), intersperse and, to some degree, also forEach.
- Bring this project's structure into your project's structure, a git submodule is a good start. I usually place it into
Frameworks/HigherOrderKit
. - Add
HigherOrderKit.xcodeproj
to your project. - For each of your targets, add HigherOrderKit's
HigherOrderKit
target as a direct dependency of the target (Target -> Command-I -> General -> Direct Dependencies). - For each of your targets, ensure
libHigherOrderKit.a
is included (linked against). - In your project, add HigherOrderKit's main directory to your Header Search Paths (
HEADER_SEARCH_PATHS
), e.g.$(SRCROOT)/Frameworks/HigherOrderKit/Sources
. - Import
HigherOrderKit.h
where you want to use HigherOrderKit; your prefix header is a good spot.
- Should we mimic the behaviour of Cocoa's API to inclue an index and stop variable in blocks arguments?