@@ -254,9 +254,6 @@ object IArray:
254
254
def :+ [U >: T : ClassTag ](x : U ): IArray [U ] = genericArrayOps(arr) :+ x
255
255
def :++ [U >: T : ClassTag ](suffix : IArray [U ]): IArray [U ] = genericArrayOps(arr) :++ suffix
256
256
def :++ [U >: T : ClassTag ](suffix : IterableOnce [U ]): IArray [U ] = genericArrayOps(arr) :++ suffix
257
- def addString (b : mutable.StringBuilder ): mutable.StringBuilder = arr.toSeq.addString(b)
258
- def addString (b : mutable.StringBuilder , sep : String ): mutable.StringBuilder = arr.toSeq.addString(b, sep)
259
- def addString (b : mutable.StringBuilder , start : String , sep : String , end : String ): mutable.StringBuilder = arr.toSeq.addString(b, start, sep, end)
260
257
def appended [U >: T : ClassTag ](x : U ): IArray [U ] = genericArrayOps(arr).appended(x)
261
258
def appendedAll [U >: T : ClassTag ](suffix : IArray [U ]): IArray [U ] = genericArrayOps(arr).appendedAll(suffix)
262
259
def appendedAll [U >: T : ClassTag ](suffix : IterableOnce [U ]): IArray [U ] = genericArrayOps(arr).appendedAll(suffix)
@@ -265,89 +262,43 @@ object IArray:
265
262
def combinations (n : Int ): Iterator [IArray [T ]] = genericArrayOps(arr).combinations(n)
266
263
def concat [U >: T : ClassTag ](suffix : IArray [U ]): IArray [U ] = genericArrayOps(arr).concat(suffix)
267
264
def concat [U >: T : ClassTag ](suffix : IterableOnce [U ]): IArray [U ] = genericArrayOps(arr).concat(suffix)
268
- def containsSlice [U ](that : IArray [U ]): Boolean = arr.toSeq.containsSlice(that.toSeq)
269
- def containsSlice [U ](that : Seq [U ]): Boolean = arr.toSeq.containsSlice(that)
270
- def corresponds [U ](that : IArray [U ])(p : (T , U ) => Boolean ): Boolean = arr.toSeq.corresponds(that.toSeq)(p)
271
- def corresponds [U ](that : IterableOnce [U ])(p : (T , U ) => Boolean ): Boolean = arr.toSeq.corresponds(that)(p)
272
265
def diff [U >: T ](that : IArray [U ]): IArray [T ] = genericArrayOps(arr).diff(that.toSeq)
273
266
def diff [U >: T ](that : Seq [U ]): IArray [T ] = genericArrayOps(arr).diff(that)
274
267
def distinct : IArray [T ] = genericArrayOps(arr).distinct
275
268
def distinctBy [U ](f : T => U ): IArray [T ] = genericArrayOps(arr).distinctBy(f)
276
- def empty : immutable.ArraySeq [T ] = arr.toSeq.empty
277
269
def startsWith [U >: T ](that : IArray [U ]): Boolean = genericArrayOps(arr).startsWith(that, 0 )
278
270
def startsWith [U >: T ](that : IArray [U ], offset : Int ): Boolean = genericArrayOps(arr).startsWith(that, offset)
279
271
def startsWith [U >: T ](that : IterableOnce [U ]): Boolean = genericArrayOps(arr).startsWith(that, 0 )
280
272
def startsWith [U >: T ](that : IterableOnce [U ], offset : Int ): Boolean = genericArrayOps(arr).startsWith(that, offset)
281
273
def endsWith [U >: T ](that : IArray [U ]): Boolean = genericArrayOps(arr).endsWith(that)
282
274
def endsWith [U >: T ](that : Iterable [U ]): Boolean = genericArrayOps(arr).endsWith(that)
283
- def findLast (p : T => Boolean ): Option [T ] = arr.toSeq.findLast(p)
284
275
def groupBy [K ](f : T => K ): immutable.Map [K , IArray [T ]] = genericArrayOps(arr).groupBy(f)
285
276
def groupMap [K , U : ClassTag ](key : T => K )(f : T => U ): immutable.Map [K , IArray [U ]] = genericArrayOps(arr).groupMap(key)(f)
286
- def groupMapReduce [K , U ](key : (T ) => K )(f : (T ) => U )(reduce : (U , U ) => U ): immutable.Map [K , U ] = arr.toSeq.groupMapReduce(key)(f)(reduce)
287
277
def grouped (size : Int ): Iterator [IArray [T ]] = genericArrayOps(arr).grouped(size)
288
- def indexOfSlice [U >: T ](that : IArray [U ]): Int = arr.toSeq.indexOfSlice(that)
289
- def indexOfSlice [U >: T ](that : Seq [U ]): Int = arr.toSeq.indexOfSlice(that)
290
- def indexOfSlice [U >: T ](that : IArray [U ], from : Int ): Int = arr.toSeq.indexOfSlice(that, from)
291
- def indexOfSlice [U >: T ](that : Seq [U ], from : Int ): Int = arr.toSeq.indexOfSlice(that, from)
292
278
def inits : Iterator [IArray [T ]] = genericArrayOps(arr).inits
293
279
def intersect [U >: T ](that : IArray [U ]): IArray [T ] = genericArrayOps(arr).intersect(that)
294
280
def intersect [U >: T ](that : Seq [U ]): IArray [T ] = genericArrayOps(arr).intersect(that)
295
- def isTraversableAgain : Boolean = arr.toSeq.isTraversableAgain
296
- def knownSize : Int = arr.length
297
- def lastIndexOfSlice [U >: T ](that : IArray [U ]): Int = arr.toSeq.lastIndexOfSlice(that)
298
- def lastIndexOfSlice [U >: T ](that : Seq [U ]): Int = arr.toSeq.lastIndexOfSlice(that)
299
- def lastIndexOfSlice [U >: T ](that : IArray [U ], end : Int ): Int = arr.toSeq.lastIndexOfSlice(that, end)
300
- def lastIndexOfSlice [U >: T ](that : Seq [U ], end : Int ): Int = arr.toSeq.lastIndexOfSlice(that, end)
301
281
def lazyZip [U ](that : IArray [U ]): LazyZip2 [T , U , IArray [T ]] = genericArrayOps(arr).lazyZip[U ](that).asInstanceOf [LazyZip2 [T , U , IArray [T ]]]
302
282
def lazyZip [U ](that : Iterable [U ]): LazyZip2 [T , U , IArray [T ]] = genericArrayOps(arr).lazyZip[U ](that).asInstanceOf [LazyZip2 [T , U , IArray [T ]]]
303
283
def lengthCompare (len : Int ): Int = genericArrayOps(arr).lengthCompare(len)
304
- def lengthIs : IterableOps .SizeCompareOps = arr.toSeq.lengthIs
305
- def max [U >: T ](using math.Ordering [U ]): T = arr.toSeq.max[U ]
306
- def maxBy [U ](f : T => U )(using math.Ordering [U ]): T = arr.toSeq.maxBy(f)
307
- def maxByOption [U ](f : T => U )(using math.Ordering [U ]): Option [T ] = arr.toSeq.maxByOption(f)
308
- def maxOption [U >: T ](using math.Ordering [U ]): Option [U ] = arr.toSeq.maxOption[U ]
309
- def min [U >: T ](using math.Ordering [U ]): T = arr.toSeq.min[U ]
310
- def minBy [U ](f : T => U )(using math.Ordering [U ]): T = arr.toSeq.minBy(f)
311
- def minByOption [U ](f : T => U )(using math.Ordering [U ]): Option [T ] = arr.toSeq.minByOption(f)
312
- def minOption [U >: T ](using math.Ordering [U ]): Option [U ] = arr.toSeq.minOption[U ]
313
- def mkString : String = arr.toSeq.mkString
314
- def mkString (sep : String ): String = arr.toSeq.mkString(sep)
315
- def mkString (start : String , sep : String , end : String ): String = arr.toSeq.mkString(start, sep, end)
316
284
def padTo [U >: T : ClassTag ](len : Int , elem : U ): IArray [U ] = genericArrayOps(arr).padTo(len, elem)
317
285
def partitionMap [T1 : ClassTag , T2 : ClassTag ](f : T => Either [T1 , T2 ]): (IArray [T1 ], IArray [T2 ]) = genericArrayOps(arr).partitionMap(f)
318
286
def patch [U >: T : ClassTag ](from : Int , other : IterableOnce [U ], replaced : Int ): IArray [U ] = genericArrayOps(arr).patch(from, other, replaced)
319
287
def permutations : Iterator [IArray [T ]] = genericArrayOps(arr).permutations
320
288
def prepended [U >: T : ClassTag ](x : U ): IArray [U ] = genericArrayOps(arr).prepended(x)
321
289
def prependedAll [U >: T : ClassTag ](prefix : IterableOnce [U ]): IArray [U ] = genericArrayOps(arr).prependedAll(prefix)
322
- def product [U >: T ](using math.Numeric [U ]): U = arr.toSeq.product[U ]
323
- def reduce [U >: T ](op : (U , U ) => U ): U = arr.toSeq.reduce(op)
324
- def reduceLeft [U >: T ](op : (U , T ) => U ): U = arr.toSeq.reduceLeft(op)
325
- def reduceRight [U >: T ](op : (T , U ) => U ): U = arr.toSeq.reduceRight(op)
326
290
def reverseIterator : Iterator [T ] = genericArrayOps(arr).reverseIterator
327
- def sameElements [U >: T ](that : IArray [U ]): Boolean = arr.toSeq.sameElements(that)
328
- def sameElements [U >: T ](that : IterableOnce [U ]): Boolean = arr.toSeq.sameElements(that)
329
291
def search [U >: T ](elem : U )(using Ordering [U ]): Searching .SearchResult = arr.toSeq.search(elem)
330
292
def search [U >: T ](elem : U , from : Int , to : Int )(using Ordering [U ]): Searching .SearchResult = arr.toSeq.search(elem, from, to)
331
- def segmentLength (p : (T ) => Boolean , from : Int ): Int = arr.toSeq.segmentLength(p, from)
332
- def segmentLength (p : (T ) => Boolean ): Int = arr.toSeq.segmentLength(p)
333
293
def sizeCompare (that : IArray [Any ]): Int = arr.toSeq.sizeCompare(that)
334
294
def sizeCompare (that : Iterable [_]): Int = arr.toSeq.sizeCompare(that)
335
295
def sizeCompare (otherSize : Int ): Int = genericArrayOps(arr).sizeCompare(otherSize)
336
- def sizeIs : IterableOps .SizeCompareOps = arr.toSeq.sizeIs
337
296
def sliding (size : Int , step : Int = 1 ): Iterator [IArray [T ]] = genericArrayOps(arr).sliding(size, step)
338
297
def stepper [S <: Stepper [_]](using StepperShape [T , S ]): S = genericArrayOps(arr).stepper[S ]
339
- def sum [U >: T ](using math.Numeric [U ]): U = arr.toSeq.sum[U ]
340
298
def tails : Iterator [IArray [T ]] = genericArrayOps(arr).tails
341
299
def tapEach [U ](f : (T ) => U ): IArray [T ] =
342
300
arr.toSeq.foreach(f)
343
301
arr
344
- def to [C1 ](factory : Factory [T , C1 ]): C1 = arr.toSeq.to(factory)
345
- def toBuffer [U >: T ]: Buffer [U ] = arr.toSeq.toBuffer[U ]
346
- def toIndexedSeq : immutable.IndexedSeq [T ] = arr.toSeq.toIndexedSeq
347
- def toIterable : Iterable [T ] = arr.toSeq.toIterable
348
- def toList : List [T ] = arr.toSeq.toList
349
- def toSet : Set [T ] = arr.toSeq.toSet
350
- def toVector : Vector [T ] = arr.toSeq.toVector
351
302
def unzip [T1 , T2 ](using asPair : T => (T1 , T2 ), ct1 : ClassTag [T1 ], ct2 : ClassTag [T2 ]): (IArray [T1 ], IArray [T2 ]) = genericArrayOps(arr).unzip
352
303
def unzip3 [T1 , T2 , T3 ](using asTriple : T => (T1 , T2 , T3 ), ct1 : ClassTag [T1 ], ct2 : ClassTag [T2 ], ct3 : ClassTag [T3 ]): (IArray [T1 ], IArray [T2 ], IArray [T3 ]) = genericArrayOps(arr).unzip3
353
304
def updated [U >: T : ClassTag ](index : Int , elem : U ): IArray [U ] = genericArrayOps(arr).updated(index, elem)
@@ -373,85 +324,49 @@ object IArray:
373
324
extension [T , U >: T : ClassTag ](x : T )
374
325
def +: (arr : IArray [U ]): IArray [U ] = genericArrayOps(arr).prepended(x)
375
326
376
- extension [T1 , T2 ](arr : IArray [(T1 , T2 )])
377
- def toMap : Map [T1 , T2 ] = arr.toSeq.toMap
378
-
379
- /** Conversion from IArray to immutable.ArraySeq */
380
- extension [T ](arr : IArray [T ]) def toSeq : immutable.ArraySeq [T ] =
381
- immutable.ArraySeq .unsafeWrapArray(arr.asInstanceOf [Array [T ]])
382
-
383
- /** Conversion from IArray to immutable.ArraySeq */
384
- extension [T <: AnyRef ](arr : IArray [T ]) def toSeq : immutable.ArraySeq [T ] =
385
- immutable.ArraySeq .ofRef(arr.asInstanceOf [Array [T ]])
386
-
387
- /** Conversion from IArray to immutable.ArraySeq */
388
- extension (arr : IArray [Int ]) def toSeq : immutable.ArraySeq [Int ] =
389
- immutable.ArraySeq .ofInt(arr.asInstanceOf [Array [Int ]])
390
-
391
- /** Conversion from IArray to immutable.ArraySeq */
392
- extension (arr : IArray [Double ]) def toSeq : immutable.ArraySeq [Double ] =
393
- immutable.ArraySeq .ofDouble(arr.asInstanceOf [Array [Double ]])
394
-
395
- /** Conversion from IArray to immutable.ArraySeq */
396
- extension (arr : IArray [Long ]) def toSeq : immutable.ArraySeq [Long ] =
397
- immutable.ArraySeq .ofLong(arr.asInstanceOf [Array [Long ]])
398
-
399
- /** Conversion from IArray to immutable.ArraySeq */
400
- extension (arr : IArray [Float ]) def toSeq : immutable.ArraySeq [Float ] =
401
- immutable.ArraySeq .ofFloat(arr.asInstanceOf [Array [Float ]])
402
-
403
- /** Conversion from IArray to immutable.ArraySeq */
404
- extension (arr : IArray [Char ]) def toSeq : immutable.ArraySeq [Char ] =
405
- immutable.ArraySeq .ofChar(arr.asInstanceOf [Array [Char ]])
406
-
407
- /** Conversion from IArray to immutable.ArraySeq */
408
- extension (arr : IArray [Byte ]) def toSeq : immutable.ArraySeq [Byte ] =
409
- immutable.ArraySeq .ofByte(arr.asInstanceOf [Array [Byte ]])
410
-
411
- /** Conversion from IArray to immutable.ArraySeq */
412
- extension (arr : IArray [Short ]) def toSeq : immutable.ArraySeq [Short ] =
413
- immutable.ArraySeq .ofShort(arr.asInstanceOf [Array [Short ]])
414
-
415
- /** Conversion from IArray to immutable.ArraySeq */
416
- extension (arr : IArray [Boolean ]) def toSeq : immutable.ArraySeq [Boolean ] =
417
- immutable.ArraySeq .ofBoolean(arr.asInstanceOf [Array [Boolean ]])
418
-
419
- /** Conversion from IArray to immutable.ArraySeq */
420
- extension (arr : IArray [Unit ]) def toSeq : immutable.ArraySeq [Unit ] =
421
- immutable.ArraySeq .ofUnit(arr.asInstanceOf [Array [Unit ]])
422
-
423
327
/** Conversion from IArray to immutable.ArraySeq */
424
- given genericWrapIArray [T ](using DummyImplicit ): Conversion [IArray [T ], immutable.ArraySeq [T ]] = _.toSeq
328
+ given genericWrapIArray [T ](using DummyImplicit ): Conversion [IArray [T ], scala.collection.immutable.ArraySeq [T ]] =
329
+ arr => scala.collection.immutable.ArraySeq .unsafeWrapArray(arr.asInstanceOf [Array [T ]])
425
330
426
331
/** Conversion from IArray to immutable.ArraySeq */
427
- given genericWrapAnyRefIArray [T <: AnyRef ](using DummyImplicit ): Conversion [IArray [T ], immutable.ArraySeq [T ]] = _.toSeq
332
+ given genericWrapAnyRefIArray [T <: AnyRef ](using DummyImplicit ): Conversion [IArray [T ], scala.collection.immutable.ArraySeq [T ]] =
333
+ arr => scala.collection.immutable.ArraySeq .ofRef(arr.asInstanceOf [Array [T ]])
428
334
429
335
/** Conversion from IArray to immutable.ArraySeq */
430
- given genericWrapIntIArray (using DummyImplicit ): Conversion [IArray [Int ], immutable.ArraySeq [Int ]] = _.toSeq
336
+ given genericWrapIntIArray (using DummyImplicit ): Conversion [IArray [Int ], scala.collection.immutable.ArraySeq [Int ]] =
337
+ arr => scala.collection.immutable.ArraySeq .ofInt(arr.asInstanceOf [Array [Int ]])
431
338
432
339
/** Conversion from IArray to immutable.ArraySeq */
433
- given genericWrapDoubleIArray (using DummyImplicit ): Conversion [IArray [Double ], immutable.ArraySeq [Double ]] = _.toSeq
340
+ given genericWrapDoubleIArray (using DummyImplicit ): Conversion [IArray [Double ], scala.collection.immutable.ArraySeq [Double ]] =
341
+ arr => scala.collection.immutable.ArraySeq .ofDouble(arr.asInstanceOf [Array [Double ]])
434
342
435
343
/** Conversion from IArray to immutable.ArraySeq */
436
- given genericWrapLongIArray (using DummyImplicit ): Conversion [IArray [Long ], immutable.ArraySeq [Long ]] = _.toSeq
344
+ given genericWrapLongIArray (using DummyImplicit ): Conversion [IArray [Long ], scala.collection.immutable.ArraySeq [Long ]] =
345
+ arr => scala.collection.immutable.ArraySeq .ofLong(arr.asInstanceOf [Array [Long ]])
437
346
438
347
/** Conversion from IArray to immutable.ArraySeq */
439
- given genericWrapFloatIArray (using DummyImplicit ): Conversion [IArray [Float ], immutable.ArraySeq [Float ]] = _.toSeq
348
+ given genericWrapFloatIArray (using DummyImplicit ): Conversion [IArray [Float ], scala.collection.immutable.ArraySeq [Float ]] =
349
+ arr => scala.collection.immutable.ArraySeq .ofFloat(arr.asInstanceOf [Array [Float ]])
440
350
441
351
/** Conversion from IArray to immutable.ArraySeq */
442
- given genericWrapCharIArray (using DummyImplicit ): Conversion [IArray [Char ], immutable.ArraySeq [Char ]] = _.toSeq
352
+ given genericWrapCharIArray (using DummyImplicit ): Conversion [IArray [Char ], scala.collection.immutable.ArraySeq [Char ]] =
353
+ arr => scala.collection.immutable.ArraySeq .ofChar(arr.asInstanceOf [Array [Char ]])
443
354
444
355
/** Conversion from IArray to immutable.ArraySeq */
445
- given genericWrapByteIArray (using DummyImplicit ): Conversion [IArray [Byte ], immutable.ArraySeq [Byte ]] = _.toSeq
356
+ given genericWrapByteIArray (using DummyImplicit ): Conversion [IArray [Byte ], scala.collection.immutable.ArraySeq [Byte ]] =
357
+ arr => scala.collection.immutable.ArraySeq .ofByte(arr.asInstanceOf [Array [Byte ]])
446
358
447
359
/** Conversion from IArray to immutable.ArraySeq */
448
- given genericWrapShortIArray (using DummyImplicit ): Conversion [IArray [Short ], immutable.ArraySeq [Short ]] = _.toSeq
360
+ given genericWrapShortIArray (using DummyImplicit ): Conversion [IArray [Short ], scala.collection.immutable.ArraySeq [Short ]] =
361
+ arr => scala.collection.immutable.ArraySeq .ofShort(arr.asInstanceOf [Array [Short ]])
449
362
450
363
/** Conversion from IArray to immutable.ArraySeq */
451
- given genericWrapBooleanIArray (using DummyImplicit ): Conversion [IArray [Boolean ], immutable.ArraySeq [Boolean ]] = _.toSeq
364
+ given genericWrapBooleanIArray (using DummyImplicit ): Conversion [IArray [Boolean ], scala.collection.immutable.ArraySeq [Boolean ]] =
365
+ arr => scala.collection.immutable.ArraySeq .ofBoolean(arr.asInstanceOf [Array [Boolean ]])
452
366
453
367
/** Conversion from IArray to immutable.ArraySeq */
454
- given genericWrapUnitIArray (using DummyImplicit ): Conversion [IArray [Unit ], immutable.ArraySeq [Unit ]] = _.toSeq
368
+ given genericWrapUnitIArray (using DummyImplicit ): Conversion [IArray [Unit ], scala.collection.immutable.ArraySeq [Unit ]] =
369
+ arr => scala.collection.immutable.ArraySeq .ofUnit(arr.asInstanceOf [Array [Unit ]])
455
370
456
371
/** Convert an array into an immutable array without copying, the original array
457
372
* must _not_ be mutated after this or the guaranteed immutablity of IArray will
0 commit comments