Skip to content

Instantly share code, notes, and snippets.

@windymelt
Last active August 29, 2015 13:56
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 windymelt/8886340 to your computer and use it in GitHub Desktop.
Save windymelt/8886340 to your computer and use it in GitHub Desktop.
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