-
-
Save lmller/6211a1c0544248f69fa0ee60d2dbb561 to your computer and use it in GitHub Desktop.
This file contains 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
infix fun<T, R> T.pipe(rhs: (T) -> R) = rhs(this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can call it e.g. like this
1..10 pipe ::println
1..10 pipe { it.reduce { l,r -> l+r }} pipe ::println