Skip to content

Instantly share code, notes, and snippets.

@cevaris
Created May 25, 2015 22:06
Show Gist options
  • Save cevaris/74b0a5aad935052f6a52 to your computer and use it in GitHub Desktop.
Save cevaris/74b0a5aad935052f6a52 to your computer and use it in GitHub Desktop.
Scala List.foldRight example
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