Created
November 13, 2017 10:57
-
-
Save NikitaMelnikov/efda079451203ed27e0fcf219b27c686 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
def doubleSay(what: String): String = s"$what $what" | |
def capitalize(what: String): String = what.capitalize | |
def exclaim(what: String): String = s"$what!" | |
implicit class PipeOps[A](a: A) { | |
def |>[B] (f: A => B): B = f(a) | |
} | |
"hello" |> doubleSay |> capitalize |> exclaim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment