Skip to content

Instantly share code, notes, and snippets.

@ajozwik
Last active August 29, 2015 13:58
Show Gist options
  • Save ajozwik/9938835 to your computer and use it in GitHub Desktop.
Save ajozwik/9938835 to your computer and use it in GitHub Desktop.
object Drop {
@tailrec
def drop[A](as: Seq[A], n: Int): Seq[A] = as match {
case Seq() => Seq()
case h +: t if n > 0 => drop(t, n - 1)
case _ => as
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment