Skip to content

Commit

Permalink
Merge pull request typelevel#357 from joroKr21/cogen-map
Browse files Browse the repository at this point in the history
Drop Ordering bound on the values in cogenMap
  • Loading branch information
non authored Oct 4, 2017
2 parents 4cf7f8f + 102654b commit bc672d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ target

/examples/simple-sbt/project/
/examples/simple-sbt/target/

# Intellij
.idea
4 changes: 2 additions & 2 deletions src/main/scala/org/scalacheck/Cogen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ object Cogen extends CogenArities with CogenLowPriority {
implicit def cogenSet[A: Cogen: Ordering]: Cogen[Set[A]] =
Cogen.it(_.toVector.sorted.iterator)

implicit def cogenMap[K: Cogen: Ordering, V: Cogen: Ordering]: Cogen[Map[K, V]] =
Cogen.it(_.toVector.sorted.iterator)
implicit def cogenMap[K: Cogen: Ordering, V: Cogen]: Cogen[Map[K, V]] =
Cogen.it(_.toVector.sortBy(_._1).iterator)

implicit def cogenFunction0[Z: Cogen]: Cogen[() => Z] =
Cogen[Z].contramap(f => f())
Expand Down

0 comments on commit bc672d9

Please sign in to comment.