Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions laws/src/main/scala/cats/laws/discipline/TraverseTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ import Prop._
trait TraverseTests[F[_]] extends FunctorTests[F] with FoldableTests[F] with UnorderedTraverseTests[F] {
def laws: TraverseLaws[F]

def traverse[A: Arbitrary, B: Arbitrary, C: Arbitrary, M: Arbitrary, X[_]: CommutativeApplicative, Y[
_
]: CommutativeApplicative](implicit
def traverse[
A: Arbitrary,
B: Arbitrary,
C: Arbitrary,
M: Arbitrary,
X[_]: CommutativeApplicative,
Y[_]: CommutativeApplicative
](implicit
ArbFA: Arbitrary[F[A]],
ArbFB: Arbitrary[F[B]],
ArbXB: Arbitrary[X[B]],
Expand Down Expand Up @@ -80,7 +85,11 @@ trait TraverseTests[F[_]] extends FunctorTests[F] with FoldableTests[F] with Uno
"traverse ref mapAccumulate" -> forAll(laws.mapAccumulateRef[M, A, C] _),
"traverse ref mapWithIndex" -> forAll(laws.mapWithIndexRef[A, C] _),
"traverse ref traverseWithIndexM" -> forAll(laws.traverseWithIndexMRef[Option, A, C] _),
"traverse ref zipWithIndex" -> forAll(laws.zipWithIndexRef[A, C] _)
"traverse ref zipWithIndex" -> forAll(laws.zipWithIndexRef[A, C] _),
"traverse ref zipWithLongIndex" -> forAll(laws.zipWithLongIndexRef[A, C] _),
"traverse ref mapWithLongIndex" -> forAll(laws.mapWithLongIndexRef[A, C] _),
"traverse ref traverseWithLongIndexM" -> forAll(laws.traverseWithLongIndexMRef[Option, A, C] _),
"traverse ref updated" -> forAll(laws.updatedRef[A, A](_, _, _))
Comment on lines 85 to +92

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, the naming of these law tests seems to be inconsistent in Cats 🤔

"get reference" -> forAll(laws.getRef[A] _),
"fold reference" -> forAll(laws.foldRef[A] _),
"toList reference" -> forAll(laws.toListRef[A] _),
"filter_ reference" -> forAll(laws.filter_Ref[A] _),
"takeWhile_ reference" -> forAll(laws.takeWhile_Ref[A] _),
"dropWhile_ reference" -> forAll(laws.dropWhile_Ref[A] _),
"collectFirstSome reference" -> forAll(laws.collectFirstSome_Ref[A, B] _),
"collectFirst reference" -> forAll(laws.collectFirst_Ref[A, B] _),

)
}
}
Expand Down