Indecipherable symbols that some people claim have actual meaning.
Note that as of Runes 1.2, master
will assume Swift 1.2. The Runes 1.1.x
series of releases are considered stable for long-term use.
github "thoughtbot/runes"
Then run carthage update
.
Follow the current instructions in Carthage's README for up to date installation instructions.
Add the following to your Podfile:
pod 'Runes'
You will also need to make sure you're opting into using frameworks:
use_frameworks!
Then run pod install
with CocoaPods 0.36 or newer.
Importing Runes introduces 3 new operators and one global function:
<^>
(pronounced "map")<*>
(pronounced "apply")>>-
(pronounced "flatMap") (left associative)-<<
(pronounced "flatMap") (right associative)pure
(pronounced "pure")
We also include default implementations for Optional and Array with the following type signatures:
// Optional:
public func <^><T, U>(f: T -> U, a: T?) -> U?
public func <*><T, U>(f: (T -> U)?, a: T?) -> U?
public func >>-<T, U>(a: T?, f: T -> U?) -> U?
public func -<<<T, U>(f: T -> U?, a: T?) -> U?
public func pure<T>(a: T) -> T?
// Array:
public func <^><T, U>(f: T -> U, a: [T]) -> [U]
public func <*><T, U>(fs: [T -> U], a: [T]) -> [U]
public func >>-<T, U>(a: [T], f: T -> [U]) -> [U]
public func -<<<T, U>(f: T -> [U], a: [T]) -> [U]
public func pure<T>(a: T) -> [T]