Last active
August 17, 2020 12:54
-
-
Save Sajjon/2d276b3bd85c5327bd3faf55536817a1 to your computer and use it in GitHub Desktop.
Operator allowing for chaining - piping - "jobs" together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precedencegroup Pipe { | |
higherThan: DefaultPrecedence | |
associativity: left | |
assignment: true | |
} | |
infix operator |>: Pipe | |
func |> <J>(input: J.Input, job: J) throws -> J.Output where J: Job { | |
try job.work(input: input) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment