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
Here, a mutable builder is used to collect the results. _ += _ is passed to zipWith which then passes it to map. But functions given to map on Covariant can be called multiple times, as is the case for List. Also, both resulting sublists are built from the same shared builder, since += on a builder returns the same mutable builder, as opposed to say :+ on Vector, which returns a new one.
The text was updated successfully, but these errors were encountered:
Hey all,
using
forEach
on a bunch of data types seems to give the wrong result:gives
List(List(1, 2, 3, 3), List(1, 2, 3, 3))
, while it should giveList(List(1, 3), List(2, 3))
or something like that.The problem seems to be in
trait CovariantIdentityBoth
in "coherent.scala":Here, a mutable builder is used to collect the results.
_ += _
is passed tozipWith
which then passes it tomap
. But functions given tomap
onCovariant
can be called multiple times, as is the case forList
. Also, both resulting sublists are built from the same shared builder, since+=
on a builder returns the same mutable builder, as opposed to say:+
on Vector, which returns a new one.The text was updated successfully, but these errors were encountered: