Skip to content

Instantly share code, notes, and snippets.

@timorantalaiho
Last active August 29, 2015 14:05
Show Gist options
  • Save timorantalaiho/5f4ae78756fd93794d49 to your computer and use it in GitHub Desktop.
Save timorantalaiho/5f4ae78756fd93794d49 to your computer and use it in GitHub Desktop.
scala> List(1,2,3,4,5).partition(_ < 3)
res0: (List[Int], List[Int]) = (List(1, 2),List(3, 4, 5))
scala> List(1,2,3,4,5).span(_ < 3)
res1: (List[Int], List[Int]) = (List(1, 2),List(3, 4, 5))
scala> :t List(1,2,3,4,5).span _
(Int => Boolean) => (List[Int], List[Int])
scala> :t List(1,2,3,4,5).partition _
(Int => Boolean) => (List[Int], List[Int])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment