Permalink
Browse files

Update to Cats 1.0.0-RC1

  • Loading branch information...
travisbrown committed Nov 1, 2017
1 parent 70aec8d commit f725b2970edc9c9b961fa24bbbc871c3ce5df654
View
@@ -20,7 +20,7 @@ lazy val compilerOptions = Seq(
"-Yno-predef"
)
lazy val catsVersion = "1.0.0-MF"
lazy val catsVersion = "1.0.0-RC1"
lazy val jawnVersion = "0.11.0"
lazy val shapelessVersion = "2.3.2"
lazy val refinedVersion = "0.8.4"
@@ -1,6 +1,6 @@
package io.circe
import cats.functor.Contravariant
import cats.Contravariant
/**
* A type class that provides a conversion from a value of type `A` to a JSON
@@ -1,8 +1,7 @@
package io.circe
import cats.Foldable
import cats.{ Contravariant, Foldable }
import cats.data.{ NonEmptyList, NonEmptyVector, OneAnd, Validated }
import cats.functor.Contravariant
import io.circe.export.Exported
import java.io.Serializable
import java.util.UUID
@@ -1,6 +1,6 @@
package io.circe
import cats.functor.Contravariant
import cats.Contravariant
import java.io.Serializable
import java.util.UUID
@@ -1,6 +1,6 @@
package io.circe
import cats.functor.Contravariant
import cats.Contravariant
import io.circe.export.Exported
/**
@@ -2,6 +2,7 @@ package io.circe.testing
import cats.instances.either._
import cats.kernel.Eq
import cats.kernel.laws.SerializableLaws
import cats.laws._
import cats.laws.discipline._
import io.circe.{ Decoder, Encoder, Json }
@@ -2,6 +2,7 @@ package io.circe.testing
import cats.data.{ Validated, ValidatedNel }
import cats.instances.either._
import cats.kernel.laws.SerializableLaws
import cats.laws._
import cats.laws.discipline._
import io.circe.{ Error, Json, Parser, ParsingFailure }
@@ -2,6 +2,7 @@ package io.circe.testing
import cats.instances.option._
import cats.kernel.Eq
import cats.kernel.laws.SerializableLaws
import cats.laws._
import cats.laws.discipline._
import io.circe.{ Decoder, Encoder, Parser, Printer }
@@ -27,8 +27,12 @@ trait MissingInstances {
implicit lazy val eqBigDecimal: Eq[BigDecimal] = Eq.fromUniversalEquals
implicit lazy val eqUUID: Eq[UUID] = Eq.fromUniversalEquals
implicit def eqRefArray[A <: AnyRef: Eq]: Eq[Array[A]] =
cats.kernel.instances.vector.catsKernelStdEqForVector[A].on(value => Predef.wrapRefArray(value).toVector)
implicit def eqSeq[A: Eq]: Eq[Seq[A]] = cats.kernel.instances.vector.catsKernelStdEqForVector[A].on(_.toVector)
Eq.by((value: Array[A]) =>
Predef.wrapRefArray(value).toVector
)(cats.kernel.instances.vector.catsKernelStdEqForVector[A])
implicit def eqSeq[A: Eq]: Eq[Seq[A]] = Eq.by((_: Seq[A]).toVector)(
cats.kernel.instances.vector.catsKernelStdEqForVector[A]
)
implicit def arbitraryTuple1[A](implicit A: Arbitrary[A]): Arbitrary[Tuple1[A]] =
Arbitrary(A.arbitrary.map(Tuple1(_)))
@@ -59,7 +63,7 @@ trait MissingInstances {
implicit def eqTuple[P: IsTuple, L <: HList](implicit
gen: Generic.Aux[P, L],
eqL: Eq[L]
): Eq[P] = eqL.on(gen.to)
): Eq[P] = Eq.by(gen.to)(eqL)
implicit lazy val arbitraryHNil: Arbitrary[HNil] = Arbitrary(Gen.const(HNil))
@@ -84,12 +88,14 @@ trait MissingInstances {
}
)
implicit def eqFieldType[K, V](implicit V: Eq[V]): Eq[FieldType[K, V]] = V.on(identity)
implicit def eqFieldType[K, V](implicit V: Eq[V]): Eq[FieldType[K, V]] =
Eq.by[FieldType[K, V], V](identity)
implicit def arbitraryFieldType[K, V](implicit V: Arbitrary[V]): Arbitrary[FieldType[K, V]] =
Arbitrary(V.arbitrary.map(field[K](_)))
implicit def eqSized[L <: Nat, C[_], A](implicit CA: Eq[C[A]]): Eq[Sized[C[A], L]] = CA.on(_.unsized)
implicit def eqSized[L <: Nat, C[_], A](implicit CA: Eq[C[A]]): Eq[Sized[C[A], L]] =
Eq.by[Sized[C[A], L], C[A]](_.unsized)
implicit def arbitrarySized[L <: Nat, C[_], A](implicit
A: Arbitrary[A],
@@ -52,7 +52,6 @@ class StdLibCodecSuite extends CirceSuite {
}
implicit def eqHashMap[Long, Int]: Eq[HashMap[Long, Int]] = Eq.fromUniversalEquals
implicit def eqSortedMap[Long, Int]: Eq[SortedMap[Long, Int]] = Eq.fromUniversalEquals
implicit val arbitraryUUID: Arbitrary[UUID] = Arbitrary(Gen.uuid)
@@ -1,7 +1,7 @@
package io.circe
import cats.laws.SerializableLaws
import cats.laws.discipline.SerializableTests
import cats.kernel.laws.SerializableLaws
import io.circe.tests.CirceSuite
class SerializableSuite extends CirceSuite {

0 comments on commit f725b29

Please sign in to comment.