Guest User

Untitled

a guest
Jan 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. def filter(xs: List[Int], p: Int => Boolean): List[Int] =
  2. if (xs.isEmpty) xs
  3. else if (p(xs.head)) xs.head :: filter(xs.tail, p)
  4. else filter(xs.tail, p)
Add Comment
Please, Sign In to add comment