Created
August 11, 2014 00:34
-
-
Save diegopacheco/b1b22e896eccd951c88a to your computer and use it in GitHub Desktop.
andThen Scala
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
scala> val doubleit = (i:Int) => i *2 | |
doubleit: Int => Int = <function1> | |
scala> val doublePlus2 = doubleit andThen ( i => i + 2) | |
doublePlus2: Int => Int = <function1> | |
scala> doublePlus2(2) | |
res0: Int = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment