CLOVIS
07/28/2019, 9:58 PM//1
Something<Pair<A, B>>
//2
data class Other<A, B>(...)
Something<Other<A, B>>
//3
typealias Other<A, B> = Pair<A, B>
Something<Other<A, B>>
I'm expecting that the answer is "it depends", what are some good examples to choose which one to use?Dico
07/29/2019, 3:32 AMPair
unless:
* You intend to access the fields not by decomposition frequently.
* At least one of your type arguments is a concrete type and the compound type is used a lot in your code
* You have special functionality for the type (such as member functions)
* Your code is performance sensitive and you want to store primitive types in the compoundDico
07/29/2019, 3:33 AMDico
07/29/2019, 3:33 AMDico
07/29/2019, 3:34 AMDico
07/29/2019, 3:35 AMDico
07/29/2019, 3:37 AM