![](https://secure.gravatar.com/avatar/72ee673975357d43d79069ac1cd6abda.jpg?s=120&d=mm&r=g)
On 29/09/20 4:19 pm, Ben Rudiak-Gould wrote:
it's worth mentioning that Haskell has tuples of length 0, 2, 3, ..., but no tuples of length 1. Tuples are meant for putting n values where 1 value is expected, and when n=1 you just put the value there.
To elaborate on that a bit, the length of a tuple is part of its static type in Haskell. It's impossible to write a function that takes a tuple of arbitrary length -- a function taking a 1-tuple could only ever take a 1-tuple, so it might as well just take the value directly. Things are different in Python -- functions can operate on tuples of varying lengths, so if 1-tuples didn't exist some things would be a bit awkward. Not sure what bearing this has, if any, on the indexing problem. -- Greg