title: Insert a new element in a specified position of a list
body: <p>There is no built-in function or a method of a List that would allow user to add a new element in a certain position of a List. I've wrote a function that does this but I'm not sure that its a good idea to do it this way, even though it works perfectly well:</p>
  
  <pre><code>def insert(list: List[Any], i: Int, value: Any) = {
    list.take(i) ++ List(value) ++ list.drop(i)
  }
  </code></pre>
  
  <p>Usage: </p>
  
  <pre><code>scala&gt; insert(List(1,2,3,5), 3, 4)
  res62: List[Any] = List(1, 2, 3, 4, 5)
  </code></pre>