Created
May 25, 2015 22:06
-
-
Save cevaris/74b0a5aad935052f6a52 to your computer and use it in GitHub Desktop.
Scala List.foldRight example
This file contains hidden or 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> (0 until 10).foldRight(1)((a, z) => {println(s"$a,$z"); a}) | |
9,1 | |
8,9 | |
7,8 | |
6,7 | |
5,6 | |
4,5 | |
3,4 | |
2,3 | |
1,2 | |
0,1 | |
res1: Int = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment