Some discussion in another thread anticipated a thread I was planning to create:
I want to ask for ideas on the best patterns for accomplishing each of the following:
-
My function inputs a collection with elements of a known data type and I want to call a function that takes a collection with generic elements of type bound by some trait so that second function can call methods of that trait on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a known data type and I want to call a function that takes a collection with generic elements of type bound by some conjunction of traits so that second function can call methods of any of these traits on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a generic data type and I want to call a function that takes a collection with generic elements of type bound by some trait so that second function can call methods of that trait on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a generic data type and I want to call a function that takes a collection with generic elements of type bound by some conjunction of traits so that second function can call methods of any of these traits on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a conjunction of known data types and I want to call a function that takes a collection with generic elements of type bound by some trait so that second function can call methods of that trait on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a conjunction of known data types and I want to call a function that takes a collection with generic elements of type bound by some conjunction of traits so that second function can call methods of any of these traits on these generic elements. I don't want to rebuild the collection to convert data types.
-
My function inputs a collection with elements of a generic data type that can be a conjunction of data types and I want to call a function that takes a collection with generic elements of type bound by some conjunction of traits so that second function can call methods of any of these traits on these generic elements. I don't want to rebuild the collection to convert data types.
Please feel free to ask for clarifications. Please feel free to offer ideas and example code on any of the numbered items.