Adding an item to an immutable Seq <p>Say, I have a sequence of strings as an input and I want to get a new immutable <code>Seq</code> which consists of elements of the input and an item <code>"c"</code>. Here are two methods that I've discovered to be working:</p> <ol> <li><code>assert(Seq("a", "b", "c") == Seq("a", "b") ++ Seq("c"))</code> - the problem with this one is that it seems that instantiating a temporary sequence (<code>Seq("c")</code>) just for the sake of the operation is rendundant and will result in overhead</li> <li><code>assert(Seq("a", "b", "c") == List("a", "b") ::: "c" :: Nil)</code> - this one restricts the type of input collection to be a <code>List</code>, so <code>Seq("a", "b") ::: "c" :: Nil</code> won't work. Also it seems that instantiating a <code>Nil</code> may aswell result in overhead</li> </ol> <p>My questions are:</p> <ol> <li>Is there any other way of performing this operation?</li> <li>Which one is better?</li> <li>Isn't <code>Seq("a", "b") ::: Nil</code> not being allowed a flaw of Scala's developers?</li> </ol>