Applying Function to `Seq[B]` in `Seq[Either[A, B]]`
The problem with @hayden.sikh's answer (the one that preserves order) is that it has a suboptimal complexity, and is especially inefficient if the Seq is a List (which it is in your REPL session). Appending an element to a list with :+ has linear complexity. Calling contains on a sequence too. So this is O(n^2).

It would be easy to adapt the answer by using a Set in the foldLeft accumulator, appending with +: and reversing the list at the end.
Or, to avoid the complexity and the cost of maintaining an immutable Set, simply use a mutable one and a flatMap:

val seen = mutable.HashSet[Int]()
xs flatMap { case Right(x) =&gt; if (seen(x)) None else { seen += x; Some(Right(x)) }  
             case x =&gt; Some(x) }


Mutability is fine as long as it's kept local, for example as a detail in an algorithm's implementation (most of the algorithms of the Scala standard library use mutability too, including distinct!).