From 494d85017bbe51e67c9c7ba433438a2e0e5bae9c Mon Sep 17 00:00:00 2001 From: Kailuo Wang Date: Tue, 1 Mar 2016 17:42:12 -0500 Subject: [PATCH] make Unapply serializable --- core/src/main/scala/cats/Unapply.scala | 2 +- tests/src/test/scala/cats/tests/UnapplyTests.scala | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/cats/Unapply.scala b/core/src/main/scala/cats/Unapply.scala index f624b69f26..b4a5e60ab7 100644 --- a/core/src/main/scala/cats/Unapply.scala +++ b/core/src/main/scala/cats/Unapply.scala @@ -13,7 +13,7 @@ package cats * Functor for Map[A,?] for any A, and for Either[A,?] for any A, * however the Scala compiler will not find them without some coercing. */ -trait Unapply[TC[_[_]], MA] { +trait Unapply[TC[_[_]], MA] extends Serializable { // a type constructor which is properly kinded for the type class type M[_] // the type applied to the type constructor to make an MA diff --git a/tests/src/test/scala/cats/tests/UnapplyTests.scala b/tests/src/test/scala/cats/tests/UnapplyTests.scala index c5f687ff70..5569332063 100644 --- a/tests/src/test/scala/cats/tests/UnapplyTests.scala +++ b/tests/src/test/scala/cats/tests/UnapplyTests.scala @@ -2,6 +2,7 @@ package cats package tests import cats.data._ +import cats.laws.discipline.SerializableTests // the things we assert here are not so much important, what is // important is that this stuff compiles at all. @@ -26,4 +27,6 @@ class UnapplyTests extends CatsSuite { z should be (List(Option((1,3)), Option((1,4)), Option((2,3)), Option((2,4)))) } + + checkAll("Unapply[Functor, Option[String]]", SerializableTests.serializable(Unapply[Functor, Option[String]])) }