Skip to content

Instantly share code, notes, and snippets.

@bbq2100
Created October 15, 2014 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbq2100/c7eca65b38030394df64 to your computer and use it in GitHub Desktop.
Save bbq2100/c7eca65b38030394df64 to your computer and use it in GitHub Desktop.
Lazy collection => View
val restrictedList = List(-2, -1, 0, 1, 2) map(2 / _)
restrictedList(0)
val nonrestrictedList = List(-2, -1, 0, 1, 2).view map(2 / _)
nonrestrictedList(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment