Tags: johnJava/parseq
Tags
Expand out varargs functions for seq / par This idea came from @sweeboonlim and neatly addresses a couple of type related problems we currently have with par and seq. The idea is to expand out the varargs for `seq` and `par` into several overloaded methods. Benefits: - Type safety for multi-arg `seq` and `par` (we did not have this before) - For `seq` we actually have stronger type-safety than we had with any other approach: now we can assert that the result type of `seq` matches the last element in the sequence. - For `par` we can assert that each task extends from a general type, making `par` neatly type-safe and covariant. Downsides: - Some method duplication (due to expanded varargs) - Definite backward compatibility breakage: usage that used an array input to `seq` or `par` would now have to use `vaseq` and `vapar` which are the varargs, type-unsafe versions.
PreviousNext