Skip to content

Instantly share code, notes, and snippets.

@thenixan
Last active June 13, 2017 11:26
Show Gist options
  • Save thenixan/b58b51c1d821693788521fa5c0def744 to your computer and use it in GitHub Desktop.
Save thenixan/b58b51c1d821693788521fa5c0def744 to your computer and use it in GitHub Desktop.
(0..10)
.asSequence()
.map {
println(it)
it
}
.filter { it % 2 == 0 }
.map { it + 10 }
.forEach { println(it) }
/**
0
10
1
2
12
3
4
14
5
6
16
7
8
18
9
10
20
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment