Skip to content

Instantly share code, notes, and snippets.

@ppiotrow
Created November 27, 2013 18:19
Show Gist options
  • Save ppiotrow/7680544 to your computer and use it in GitHub Desktop.
Save ppiotrow/7680544 to your computer and use it in GitHub Desktop.
package pl.japila.scalania.s99
object S99_P21 {
def insertAt[T](toAdd: T, position: Int, ts: Seq[T]): Seq[T] = ts.take(position) ++ Seq(toAdd) ++ ts.drop(position)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment