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 11, 2018
1 parent 1a04fff commit dfc8759
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/main/scala/cats/implicits.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package cats

object implicits extends syntax.AllSyntax with instances.AllInstances
with syntax.TraverseSyntaxBinCompat0
4 changes: 2 additions & 2 deletions 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 AllSyntax with TraverseSyntaxBinCompat0
object alternative extends AlternativeSyntax
object applicative extends ApplicativeSyntax
object applicativeError extends ApplicativeErrorSyntax
Expand Down Expand Up @@ -44,7 +44,7 @@ package object syntax {
object semigroupk extends SemigroupKSyntax
object show extends ShowSyntax
object strong extends StrongSyntax
object traverse extends TraverseSyntax
object traverse extends TraverseSyntax with TraverseSyntaxBinCompat0
object nonEmptyTraverse extends NonEmptyTraverseSyntax
object validated extends ValidatedSyntax
object vector extends VectorSyntax
Expand Down
1 change: 1 addition & 0 deletions core/src/main/scala/cats/syntax/traverse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ package cats
package syntax

trait TraverseSyntax extends Traverse.ToTraverseOps
trait TraverseSyntaxBinCompat0 extends UnorderedTraverse.ToUnorderedTraverseOps
2 changes: 2 additions & 0 deletions testkit/src/main/scala/cats/tests/CatsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import catalysts.Platform

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

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

implicit override val generatorDrivenConfig: PropertyCheckConfiguration =
Expand Down
8 changes: 8 additions & 0 deletions tests/src/test/scala/cats/tests/TraverseSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ class TraverseSuiteAdditional extends CatsSuite {
checkZipWithIndexedStackSafety[Vector](_.toVector)
}
}

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 dfc8759

Please sign in to comment.