SLC: Improve pattern matching on Array / IArray

I have recently migrated the codebase from Vector to IArray, because it is the perfect collection for so many use-cases. I have encountered many quirks and have reported the bugs to you. But there is one major one remaining.

Here I propose two improvements:

1: Spread matching should return IArray, not ArraySeq

array match {
   case IArray(a, middle*, b) => // middle is ArraySeq
}

The problem is not just the ArraySeq wrapper object, but how difficult is it to convert ArraySeq back to IArray, especially because the arrays of primitives have their specifics. I think the code is, but it might be wrong:

IArray.unsafeFromArray(
    middle.unsafeArray.asInstanceOf[Array[Int]]
  )

Imagine writing this every time, it is not pretty.

2: Support :+ destructuring

Since the multiSpreads SIP-70 improvement, this is less esential, but it would be a nice win for ortnogonality, especially when you are migrating the codebase from Vector.

I have heard an objection in the other thread that this might not be very performant, but to do it once in a while, it is okay. Assuming it uses System.arrayCopy under the hood, it beats all other collection types that support :+:

  1. ArraySeq: Same performance
  2. Vector: Might be very much slower for small collections of under 100 elements.
  3. List: Absolutely terrible performance, yet it is allowed.