| As Haskell has the standard functions fst, snd to decompose (a,b),
| maybe, it worths to provide also
| tuple31, tuple31, tuple31,
| ...
| tuple51, tuple52, tuple53, tuple54, tuple55
|
| for the tuples of n = 3,4,5 ?
Simon PJ and I have written a proposal for Lightweight extensible
records in Haskell. You can find the most recent version on Simon's
web page or in the link that Erik posted to the proceedings of the
upcoming Haskell workshop. With the ideas described there, tuples
could be implemented as records, with labels chosen in some natural
way. (This idea comes from SML.) For example, you could treat
(e,f,g) as a short hand for {1=e, 2=f, 3=g}. And, if you have a
tuple t with at least three components, then you can write t.1, t.2,
and t.3 to extract those values. Notice that you don't have to say
anything about the size of the tuple; the type system will figure
that out for you, and complain as appropriate if you try to access
a component that isn't there. I think this would be a more attractive
solution than introducing a new, potentially unbounded family of
somewhat awkwardly named projection operators..
All the best,
Mark