Skip to content

Commit

Permalink
make Unapply serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuowang committed Mar 1, 2016
1 parent ee9a6af commit 494d850
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Unapply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/src/test/scala/cats/tests/UnapplyTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand 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]]))
}

0 comments on commit 494d850

Please sign in to comment.