Skip to content

Instantly share code, notes, and snippets.

@windymelt

windymelt/failable.scala

Last active Aug 29, 2015
Embed
What would you like to do?
unfold_example1
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