You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the existing bifoldable laws for Binested fail if you use Tuple2 instead of Either as the two-slot type constructor, and a non-commutative monoid for the innermost types. e.g. adding
fails cats.tests.BinestedSuite.Binested[Tuple2, ListWrapper, ListWrapper, *, *]: bitraverse.bifoldRight consistent with bifoldMap, vs the existing one, which passes:
Assuming the implementation is correct and the failure hasn't revealed a bug, it makes me wonder if there's a way to encode this in the types. Should the C: Monoid on BitraverseTests.bitraverse be C: CommutativeMonoid so that the law is more universal? If so, how far up the chain should that propagate? Ultimately it's used in BifoldableLaws.bifoldLeftConsistentWithBifoldMap and BifoldableLaws.bifoldRightConsistentWithBifoldMap.
The text was updated successfully, but these errors were encountered:
I noticed that the existing
bifoldable
laws forBinested
fail if you useTuple2
instead ofEither
as the two-slot type constructor, and a non-commutative monoid for the innermost types. e.g. addingfails
cats.tests.BinestedSuite.Binested[Tuple2, ListWrapper, ListWrapper, *, *]: bitraverse.bifoldRight consistent with bifoldMap
, vs the existing one, which passes:cats/tests/shared/src/test/scala/cats/tests/BinestedSuite.scala
Lines 86 to 90 in b036fb4
Assuming the implementation is correct and the failure hasn't revealed a bug, it makes me wonder if there's a way to encode this in the types. Should the
C: Monoid
onBitraverseTests.bitraverse
beC: CommutativeMonoid
so that the law is more universal? If so, how far up the chain should that propagate? Ultimately it's used inBifoldableLaws.bifoldLeftConsistentWithBifoldMap
andBifoldableLaws.bifoldRightConsistentWithBifoldMap
.The text was updated successfully, but these errors were encountered: