Skip to content

Instantly share code, notes, and snippets.

@quiye
Last active February 18, 2018 13:21
Show Gist options
  • Save quiye/611f08159e9b8c71213352d9f2a2ed6a to your computer and use it in GitHub Desktop.
Save quiye/611f08159e9b8c71213352d9f2a2ed6a to your computer and use it in GitHub Desktop.
scalaでパイプライン演算子(repl (amm) )
@ val nijo = (x:Int) => x*x
nijo: Int => Int = ammonite.$sess.cmd2$$$Lambda$1945/330224683@51ed2f68
@ val minus10 = (x:Int) => x-10
minus10: Int => Int = ammonite.$sess.cmd3$$$Lambda$1949/497232815@a80a896
@ 4 |> nijo |> minus10
res4: Int = 6
@ val hoge = 4 |> nijo |> minus10
hoge: Int = 6
@ val g = minus10(nijo(4))
g: Int = 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment