Last active
August 29, 2015 13:56
-
-
Save windymelt/8886340 to your computer and use it in GitHub Desktop.
unfold_example1
This file contains 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 failable: Int => Option[Int] = { | |
(n: Int) => | |
n match { | |
case n if 0 until 100 contains n => Some(n + 1) | |
case otherwise => None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment