Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unifies NonEmpty datatypes on 2.13 to the Newtype encoding #2930

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ad616a7
make NonEmptyStreamSuite 2.12- specific
kailuowang Jun 21, 2019
e03f4e4
reformat
kailuowang Jun 21, 2019
03aa5b7
partially converted NonEmptyLazyList from NonEmptyList
nathaniel-may Jun 27, 2019
8e10a99
better TODOs and replaced occurrances of Nil
nathaniel-may Jun 27, 2019
6e90505
first pass at intended impl
nathaniel-may Jun 28, 2019
fcdd483
fixed imports
nathaniel-may Jun 28, 2019
7b6b58c
removed collectFirstSome. Defers to default instance impl
nathaniel-may Jun 28, 2019
57cf435
reduceLeftTo and reduceRightTo now uses same impl from NonEmptyChain
nathaniel-may Jun 28, 2019
14dd3da
refactored instances to pull from existing LazyList instances
nathaniel-may Jun 28, 2019
fe1ac0c
fix compilation
kailuowang Jun 28, 2019
c1d8e76
added missing instances for NonEmptyLazyList
kailuowang Jul 2, 2019
da83de2
moved NonEmptyChain to new structure
kailuowang Jul 2, 2019
bce53d3
NonEmptyVector is moved to new structure
kailuowang Jul 3, 2019
9585857
refactor tests
kailuowang Jul 3, 2019
85dfb8f
refactor use a single base trait
kailuowang Jul 3, 2019
d0519fa
moving NonEmptyList to new structure
kailuowang Jul 3, 2019
35fd2c1
reformat
kailuowang Jul 3, 2019
ecf5a70
maintain BC
kailuowang Jul 3, 2019
a591a23
Merge branch 'master' into refactorNonEmpty
kailuowang Jul 4, 2019
c177384
Update NonEmptyStreamSuite.scala
kailuowang Jul 4, 2019
897b4a9
fix new kind projector
kailuowang Jul 4, 2019
9eb3b26
minor rename to make it more consistent
kailuowang Jul 8, 2019
e97fb20
remove unused file
kailuowang Jul 9, 2019
57e4ea7
Update ScalaVersionSpecific.scala
kailuowang Jul 9, 2019
e8df134
Update ScalaVersionSpecific.scala
kailuowang Jul 9, 2019
fee01b8
correct filename
kailuowang Jul 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import cats.data.NonEmptyVector.ZipNonEmptyVector
import scala.annotation.tailrec
import scala.collection.immutable.{TreeSet, VectorBuilder}
import cats.instances.vector._
import kernel.compat.scalaVersionSpecific._

/**
* A data type which represents a `Vector` guaranteed to contain at least one element.
Expand Down Expand Up @@ -219,7 +218,7 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) extends AnyVal
* }}}
*/
def zipWith[B, C](b: NonEmptyVector[B])(f: (A, B) => C): NonEmptyVector[C] =
NonEmptyVector.fromVectorUnsafe(toVector.lazyZip(b.toVector).map(f))
NonEmptyVector.fromVectorUnsafe((toVector, b.toVector).zipped.map(f))

def reverse: NonEmptyVector[A] =
new NonEmptyVector(toVector.reverse)
Expand All @@ -234,7 +233,6 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A]) extends AnyVal
new NonEmptyVector(toVector.sorted(AA.toOrdering))
}

@suppressUnusedImportWarningForScalaVersionSpecific
sealed abstract private[data] class NonEmptyVectorInstances {

implicit val catsDataInstancesForNonEmptyVector: SemigroupK[NonEmptyVector]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cats

package data

abstract private[data] class ScalaVersionSpecificPackage
Loading