Haskell-newbie reporting in.
Question is as follows:
In Haskell, we have fst
and snd
that return the first and the second elements of a 2-tuple. Wh
N-tuples are not a data structure for indexing via an Int
key, instead, you should look at one indexed-biased data structures, such as arrays or finger-trees.
Now, one could imagine writing a typeclass for a family of tuple types providing an index operation, however, we already have arrays for that, and there's a lot of boilerplate necessary to make tuples of any type seamlessly provide this operation. The power gained isn't worth the effort.