Why does the Scala library only defines tuples up to Tuple22?

后端 未结 4 1154
予麋鹿
予麋鹿 2020-12-20 11:19

I\'m curious if anyone knows why the Scala library stops at 22 with its tuple type Tuple22?
Does the mysterious number 22 have a s

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-20 12:13

    I believe it has to do with difficulties in implementing a static type system while having variadic (arbitrary-argument) functions. I believe apply can be written in Scala (though not in Haskell, at least not elegantly).

提交回复
热议问题