Pipe-forward operator |>

@fvasco, to give your extension of @oluwasayo’s idea a concrete example:

val result = pipeline(
  ::sanitize,
  ::validate,
  ::parse,
  ::process,
  ::optimize,
  ::publish
)

This is indeed pretty nice and would avoid the uglyness of |> (which could easily win the “ugliest Kotlin operator” award). Plus, pipeline would be self-explanatory, whereas |> looks like some Perl programmer came to life again.

4 Likes