Created
February 18, 2013 20:47
-
-
Save iainmcgin/4980569 to your computer and use it in GitHub Desktop.
Use of lazy views to prevent multiple transformations on a list.
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
val numbersAsStrings = Seq("1", "4", "5", "7", "8", "20", "10") | |
val ints = (numbersAsStrings.view map { _.toInt } filter {_ % 2 == 0}).force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment