Skip to content

Instantly share code, notes, and snippets.

@macbaszii
Created August 24, 2015 07:50
Show Gist options
  • Select an option

  • Save macbaszii/75a968fa1761f04ea563 to your computer and use it in GitHub Desktop.

Select an option

Save macbaszii/75a968fa1761f04ea563 to your computer and use it in GitHub Desktop.
infix operator <*> { associativity left }
func <*><T, U>(f: (T -> U)?, a: T?) -> U? {
return a.apply(f)
}
func <*><T, U>(f: [T -> U], a: [T]) -> [U] {
return a.apply(f)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment