Skip to content

Commit

Permalink
Add missing .unorderedTraverse syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
andyscott committed Jan 25, 2018
1 parent 1a04fff commit 6375e01
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
5 changes: 4 additions & 1 deletion core/src/main/scala/cats/implicits.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
package cats

object implicits extends syntax.AllSyntax with instances.AllInstances
object implicits
extends syntax.AllSyntax
with syntax.AllSyntaxBinCompat0
with instances.AllInstances
7 changes: 7 additions & 0 deletions core/src/main/scala/cats/syntax/all.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package cats
package syntax

abstract class AllSyntaxBinCompat
extends AllSyntax
with AllSyntaxBinCompat0

trait AllSyntax
extends AlternativeSyntax
with ApplicativeSyntax
Expand Down Expand Up @@ -48,3 +52,6 @@ trait AllSyntax
with ValidatedSyntax
with VectorSyntax
with WriterSyntax

trait AllSyntaxBinCompat0
extends UnorderedTraverseSyntax
3 changes: 2 additions & 1 deletion core/src/main/scala/cats/syntax/package.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats

package object syntax {
object all extends AllSyntax
object all extends AllSyntaxBinCompat
object alternative extends AlternativeSyntax
object applicative extends ApplicativeSyntax
object applicativeError extends ApplicativeErrorSyntax
Expand Down Expand Up @@ -46,6 +46,7 @@ package object syntax {
object strong extends StrongSyntax
object traverse extends TraverseSyntax
object nonEmptyTraverse extends NonEmptyTraverseSyntax
object unorderedTraverse extends UnorderedTraverseSyntax
object validated extends ValidatedSyntax
object vector extends VectorSyntax
object writer extends WriterSyntax
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/scala/cats/syntax/unorderedTraverse.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package cats
package syntax

trait UnorderedTraverseSyntax extends UnorderedTraverse.ToUnorderedTraverseOps
4 changes: 2 additions & 2 deletions testkit/src/main/scala/cats/tests/CatsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package tests
import catalysts.Platform

import cats.instances.AllInstances
import cats.syntax.{AllSyntax, EqOps}
import cats.syntax.{AllSyntax, AllSyntaxBinCompat0, EqOps}

import org.scalactic.anyvals.{PosZDouble, PosInt, PosZInt}
import org.scalatest.{FunSuite, FunSuiteLike, Matchers}
Expand Down Expand Up @@ -36,7 +36,7 @@ trait CatsSuite extends FunSuite
with Discipline
with TestSettings
with AllInstances
with AllSyntax
with AllSyntax with AllSyntaxBinCompat0
with StrictCatsEquality { self: FunSuiteLike =>

implicit override val generatorDrivenConfig: PropertyCheckConfiguration =
Expand Down
10 changes: 10 additions & 0 deletions tests/src/test/scala/cats/tests/UnorderedTraverseSuite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package cats
package tests

class UnorderedTraverseSuite extends CatsSuite {
test("UnorderedTraverse[Set[Int]].unorderedTraverse via syntax") {
forAll { (ins: Set[Int]) =>
ins.unorderedTraverse(in => in: Id[Int]).toList.sorted should === (ins.toList.sorted)
}
}
}

0 comments on commit 6375e01

Please sign in to comment.