Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created January 29, 2018 21:24
Show Gist options
  • Save olbrichj/fd38f73f94aeeebb75261c4736685dbe to your computer and use it in GitHub Desktop.
Save olbrichj/fd38f73f94aeeebb75261c4736685dbe to your computer and use it in GitHub Desktop.
precedencegroup OperationChaining {
associativity: left
}
infix operator ==> : OperationChaining
@discardableResult
func ==><T: Operation>(lhs: T, rhs: T) -> T {
rhs.addDependency(lhs)
return rhs
}
operation1 ==> operation2 ==> operation3 // Execute in order 1 to 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment