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
The choice of base Seq type was beneficial in terms of perfomance (as we sometimes avoid copying the collection), but proves to problematic, especially in Scala 2.13, where Seq aliases immutable.Seq. This introduces compatibility issues e.g. with Scalatags, which only accept immutable collections. Therefore, after 1:1 migration of our codebase for 2.13 (#434), we had to introduce .toSeq calls in some usages:
produce(p)(s => s.toSeq.render)
This particular issue was patched by explicit copying, but it's not a comprehensive solution, as ReadableSeqProperty[A] <: ReadableProperty[scala.collection.Seq[A], which introduces base Seq type to multiple API methods.
Proposed acceptance criteria:
only allow immutable sequences in SeqProperties (remove io.udash.properties.PropertyCreator#materializeBSeq)
ensure public API of SeqProperty is ISeq-based (especially .get, .listen etc.)
ensure consistency with above for .subSeq, .roSubSeq
use a thin wrapper / copy-on-write to avoid copying in all cases. This will also benefit the performance for past cases where an immutable collection was used as a model subsequence.
performance should be on-par with 0.8.x
The text was updated successfully, but these errors were encountered:
SeqProperties based on immutable models usually return immutable collections:
model.subProp(_.vector).get //Vector[Int]
but direct usage is not quite as good:
The choice of base
Seq
type was beneficial in terms of perfomance (as we sometimes avoid copying the collection), but proves to problematic, especially in Scala 2.13, whereSeq
aliasesimmutable.Seq
. This introduces compatibility issues e.g. with Scalatags, which only accept immutable collections. Therefore, after 1:1 migration of our codebase for 2.13 (#434), we had to introduce.toSeq
calls in some usages:produce(p)(s => s.toSeq.render)
This particular issue was patched by explicit copying, but it's not a comprehensive solution, as
ReadableSeqProperty[A] <: ReadableProperty[scala.collection.Seq[A]
, which introduces baseSeq
type to multiple API methods.Proposed acceptance criteria:
io.udash.properties.PropertyCreator#materializeBSeq
)SeqProperty
isISeq
-based (especially.get
,.listen
etc.).subSeq
,.roSubSeq
0.8.x
The text was updated successfully, but these errors were encountered: