Last active
August 29, 2015 13:58
-
-
Save ajozwik/9938835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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