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
@non@tixxit and I were talking about mapVectorEq and for instance the Group on Map[K, V] that assumes that a missing key is the same as Group.empty.
This has some issues. Without the correct Eq[Map[K, V]] in scope, you violate the laws. Moreover, the standard Eq should not be one that has this behavior, because that does not make sense for a lot of use cases.
Our solution is to wrap such instances:
// infinite map defined at all keys KtraitSparseMap[K, V] {
defget(k: K):Vdefupdated(k: K, v: V):SparseMap[K, V]
deftoMap:Map[K, V]
}
// an infinite vector that is defined at all points (i: Int)traitSparseVector[T] {
defapply(i: Int):Tdefupdated(i: Int, v: T):SparseVector[T]
deftoVector:Vector[T]
}
In this way #126 would be an instance on SparseMap
@non @tixxit and I were talking about
mapVectorEqand for instance theGrouponMap[K, V]that assumes that a missing key is the same asGroup.empty.This has some issues. Without the correct
Eq[Map[K, V]]in scope, you violate the laws. Moreover, the standardEqshould not be one that has this behavior, because that does not make sense for a lot of use cases.Our solution is to wrap such instances:
In this way #126 would be an instance on
SparseMap