utenma
09/20/2024, 1:03 AMAlejandro Serrano.Mena
09/20/2024, 7:33 AMutenma
09/20/2024, 4:25 PMPair
,Triple
example on chessboard grid which is 8x8 would use Tuple8
> Tuples VS case class
• For library authors, tuples could be used without importing classes like Pair , Triple, for the case on names tuples they can entirely replace any case or data class example:
• typealias Point = (x:float, y: float)
• Tuples are also used on map
, flatMap
streams to generate next chain data
• Named tuples on scala where also pushed to improve scala-sql mappings as names tuples can be generated on the fly, same can be said for a kotlin/ktor compiler plugin
> How long are tuples?
Longest tuple has been of size 8 for chess/checker board rows/columns