Skip to content

Commit

Permalink
overrides for mapWithLongIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
nikololiahim committed Jun 21, 2022
1 parent c1f9ed6 commit 71eb69b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/data/Chain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,9 @@ sealed abstract private[data] class ChainInstances extends ChainInstances1 {
override def mapWithIndex[A, B](fa: Chain[A])(f: (A, Int) => B): Chain[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

override def mapWithLongIndex[A, B](fa: Chain[A])(f: (A, Long) => B): Chain[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def zipWithIndex[A](fa: Chain[A]): Chain[(A, Int)] =
fa.zipWithIndex

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/data/NonEmptyChain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,9 @@ sealed abstract private[data] class NonEmptyChainInstances extends NonEmptyChain
override def mapWithIndex[A, B](fa: NonEmptyChain[A])(f: (A, Int) => B): NonEmptyChain[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

override def mapWithLongIndex[A, B](fa: NonEmptyChain[A])(f: (A, Long) => B): NonEmptyChain[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def zipWithIndex[A](fa: NonEmptyChain[A]): NonEmptyChain[(A, Int)] =
fa.zipWithIndex

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/data/NonEmptyList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,9 @@ sealed abstract private[data] class NonEmptyListInstances extends NonEmptyListIn
override def mapWithIndex[A, B](fa: NonEmptyList[A])(f: (A, Int) => B): NonEmptyList[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

override def mapWithLongIndex[A, B](fa: NonEmptyList[A])(f: (A, Long) => B): NonEmptyList[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def zipWithIndex[A](fa: NonEmptyList[A]): NonEmptyList[(A, Int)] =
fa.zipWithIndex

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/data/NonEmptyVector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ sealed abstract private[data] class NonEmptyVectorInstances {
): (S, NonEmptyVector[B]) =
StaticMethods.mapAccumulateFromStrictFunctor(init, fa, f)(this)

override def mapWithLongIndex[A, B](fa: NonEmptyVector[A])(f: (A, Long) => B): NonEmptyVector[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def mapWithIndex[A, B](fa: NonEmptyVector[A])(f: (A, Int) => B): NonEmptyVector[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/instances/list.scala
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ trait ListInstances extends cats.kernel.instances.ListInstances {
override def mapAccumulate[S, A, B](init: S, fa: List[A])(f: (S, A) => (S, B)): (S, List[B]) =
StaticMethods.mapAccumulateFromStrictFunctor(init, fa, f)(this)

override def mapWithLongIndex[A, B](fa: List[A])(f: (A, Long) => B): List[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def mapWithIndex[A, B](fa: List[A])(f: (A, Int) => B): List[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/instances/queue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ trait QueueInstances extends cats.kernel.instances.QueueInstances {
override def mapAccumulate[S, A, B](init: S, fa: Queue[A])(f: (S, A) => (S, B)): (S, Queue[B]) =
StaticMethods.mapAccumulateFromStrictFunctor(init, fa, f)(this)

override def mapWithLongIndex[A, B](fa: Queue[A])(f: (A, Long) => B): Queue[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def mapWithIndex[A, B](fa: Queue[A])(f: (A, Int) => B): Queue[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/instances/vector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ trait VectorInstances extends cats.kernel.instances.VectorInstances {
override def mapWithIndex[A, B](fa: Vector[A])(f: (A, Int) => B): Vector[B] =
StaticMethods.mapWithIndexFromStrictFunctor(fa, f)(this)

override def mapWithLongIndex[A, B](fa: Vector[A])(f: (A, Long) => B): Vector[B] =
StaticMethods.mapWithLongIndexFromStrictFunctor(fa, f)(this)

override def zipWithIndex[A](fa: Vector[A]): Vector[(A, Int)] =
fa.zipWithIndex

Expand Down

0 comments on commit 71eb69b

Please sign in to comment.