Skip to content

Commit

Permalink
Merge pull request #497 from drostron/set-monoid-instance
Browse files Browse the repository at this point in the history
add setMonoid
  • Loading branch information
ceedubs committed Sep 11, 2015
2 parents 82da887 + 345df6c commit 2d5c6e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/scala/cats/std/set.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ trait SetInstances extends algebra.std.SetInstances {

override def isEmpty[A](fa: Set[A]): Boolean = fa.isEmpty
}

implicit def setMonoid[A]: Monoid[Set[A]] = MonoidK[Set].algebra[A]
}
2 changes: 2 additions & 0 deletions tests/shared/src/test/scala/cats/tests/SetTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package tests
import cats.laws.discipline.{FoldableTests, MonoidKTests, SerializableTests}

class SetTests extends CatsSuite {
checkAll("Set[Int]", algebra.laws.GroupLaws[Set[Int]].monoid)

checkAll("Set[Int]", MonoidKTests[Set].monoidK[Int])
checkAll("MonoidK[Set]", SerializableTests.serializable(MonoidK[Set]))

Expand Down

0 comments on commit 2d5c6e1

Please sign in to comment.