Is Tuple2 and Pair the same or not?

Is there a difference between the Tuple2 and Pair classes in scala?

It seems to me that they are doing the same thing.

+6
source share
1 answer

Yes. both are the same

 type Pair[+A, +B] = Tuple2[A, B] 

https://github.com/scala/scala/blob/v2.9.2/src/library/scala/Predef.scala#L1 line 227

+13
source

Source: https://habr.com/ru/post/915344/


All Articles