Vectors are strict and have O (1) subsets (e.g. take). They also have optimized insertion and deletion. This way, you will sometimes see increased productivity by switching data on the fly. However, as a rule, this is the wrong approach - it is better to store all the data in one or another form. (And you also use UArrays, which confuses the problem even more).
General rules:
If the data is large and can only be converted in a massive way, the use of reasonable efficient structures such as vectors makes sense.
If the data is small and intersects linearly, rarely, then lists make sense.
Remember that operations on lists and vectors have different complexity, therefore, if iterate . replicate iterate . replicate in lists is O (n), but lazy, the same thing on vectors will not necessarily be just as efficient (you should prefer the built-in methods in a vector to generate arrays).
As a rule, vectors should always be better for numerical operations. You may need to use different functions that you do in lists.
I would stick with vectors only. Avoid UArrays and avoid lists except generators.
Don stewart
source share