@@ -386,25 +386,41 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A])
386
386
@ suppressUnusedImportWarningForScalaVersionSpecific
387
387
sealed abstract private [data] class NonEmptyVectorInstances {
388
388
389
+ @ deprecated(
390
+ " maintained for the sake of binary compatibility only - use catsDataInstancesForNonEmptyChainBinCompat1 instead" ,
391
+ " 2.9.0"
392
+ )
393
+ def catsDataInstancesForNonEmptyVector : SemigroupK [NonEmptyVector ]
394
+ with Bimonad [NonEmptyVector ]
395
+ with NonEmptyTraverse [NonEmptyVector ]
396
+ with Align [NonEmptyVector ] =
397
+ catsDataInstancesForNonEmptyVectorBinCompat1
398
+
389
399
/**
390
400
* This is not a bug. The declared type of `catsDataInstancesForNonEmptyVector` intentionally ignores
391
401
* `NonEmptyReducible` trait for it not being a typeclass.
392
402
*
393
403
* Also see the discussion: PR #3541 and issue #3069.
394
404
*/
395
- implicit val catsDataInstancesForNonEmptyVector : SemigroupK [NonEmptyVector ]
405
+ implicit val catsDataInstancesForNonEmptyVectorBinCompat1 : NonEmptyAlternative [NonEmptyVector ]
396
406
with Bimonad [NonEmptyVector ]
397
407
with NonEmptyTraverse [NonEmptyVector ]
398
408
with Align [NonEmptyVector ] =
399
409
new NonEmptyReducible [NonEmptyVector , Vector ]
400
- with SemigroupK [NonEmptyVector ]
410
+ with NonEmptyAlternative [NonEmptyVector ]
401
411
with Bimonad [NonEmptyVector ]
402
412
with NonEmptyTraverse [NonEmptyVector ]
403
413
with Align [NonEmptyVector ] {
404
414
405
415
def combineK [A ](a : NonEmptyVector [A ], b : NonEmptyVector [A ]): NonEmptyVector [A ] =
406
416
a.concatNev(b)
407
417
418
+ override def prependK [A ](a : A , fa : NonEmptyVector [A ]): NonEmptyVector [A ] =
419
+ fa.prepend(a)
420
+
421
+ override def appendK [A ](fa : NonEmptyVector [A ], a : A ): NonEmptyVector [A ] =
422
+ fa.append(a)
423
+
408
424
override def split [A ](fa : NonEmptyVector [A ]): (A , Vector [A ]) = (fa.head, fa.tail)
409
425
410
426
override def size [A ](fa : NonEmptyVector [A ]): Long = fa.length.toLong
@@ -550,14 +566,14 @@ sealed abstract private[data] class NonEmptyVectorInstances {
550
566
implicit def catsDataShowForNonEmptyVector [A : Show ]: Show [NonEmptyVector [A ]] = _.show
551
567
552
568
implicit def catsDataSemigroupForNonEmptyVector [A ]: Semigroup [NonEmptyVector [A ]] =
553
- catsDataInstancesForNonEmptyVector .algebra
569
+ catsDataInstancesForNonEmptyVectorBinCompat1 .algebra
554
570
555
571
implicit def catsDataParallelForNonEmptyVector : NonEmptyParallel .Aux [NonEmptyVector , ZipNonEmptyVector ] =
556
572
new NonEmptyParallel [NonEmptyVector ] {
557
573
type F [x] = ZipNonEmptyVector [x]
558
574
559
575
def apply : Apply [ZipNonEmptyVector ] = ZipNonEmptyVector .catsDataCommutativeApplyForZipNonEmptyVector
560
- def flatMap : FlatMap [NonEmptyVector ] = NonEmptyVector .catsDataInstancesForNonEmptyVector
576
+ def flatMap : FlatMap [NonEmptyVector ] = NonEmptyVector .catsDataInstancesForNonEmptyVectorBinCompat1
561
577
562
578
def sequential : ZipNonEmptyVector ~> NonEmptyVector =
563
579
new (ZipNonEmptyVector ~> NonEmptyVector ) { def apply [A ](a : ZipNonEmptyVector [A ]): NonEmptyVector [A ] = a.value }
0 commit comments