I have some old code which relied on implicit CanBuildFrom
in order to build a collection of a type specified as a type parameter. Since 2.12, in new collection library, replacement BuildFrom
doesn't offer a no-arg Builder
factory method. What I want is the IterableFactory
for the collection, but these are companion objects, which are not implicit. Can I somehow port it without introducing my own implicit factory class wrapping a Factory
for every collection class in the library? I know that there are many flavours to those factories, but even if I had to add a special case for those accepting implicit evidence, it would still be much better than what I have.
A sensible alternative in new code would probably be to take the IterableFactory
as a (value) argument instead of relying on explicit type arguments, but it would require changes in too many places, so I'd rather stick to the current architecture and do the boilerplate.