Skip to content

Instantly share code, notes, and snippets.

@paulp
Last active January 2, 2016 00:59
Show Gist options
  • Save paulp/8227277 to your computer and use it in GitHub Desktop.
Save paulp/8227277 to your computer and use it in GitHub Desktop.
scala> def drop[T](xs: List[T], n: Int) = if (xs.isEmpty || n <= 0) xs else drop(xs.tail, n - 1)
drop: [T](xs: List[T], n: Int)List[T]
scala> drop(List(1,2,3,4,5), 3)
res0: List[Int] = List(4, 5)
@paulp
Copy link
Author

paulp commented Jan 3, 2014

I'm aware of the prerequisite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment