Here is a another solution using fold that has the similar performance characteristics. One difference is that it doenstdoesn't have to compute the linear List Length
def inserts[A](x: A): List[A] => List[List[A]] =
ls =>
ls match {
case Nil => List(List(x))
case (y :: ys) => (x :: y :: ys) :: (inserts(x)(ys)).map(z => y :: z_)
}
def permutations[A](ls: List[A]): List[List[A]] =
ls.foldRight(List(List[A]()))((x, xss) => xss.flatMap(inserts(x)))