
That would not be economical. Lets just say people never use more than
8-tuple and then try to count how many functions you would need.
The "tuple" package on Haskell provides a generic interface to
access/manipulate the k'th element of an n-tuple. That should be
sufficient and is not subject to combinatorical explosion (well the
instance are a bit).
Gruss,
Christian
* Serge D. Mechveliani
People, I define, for example, tuple42 (_, y, _, _) = y, setTuple42 (x, _, z, u) y = (x, y, z, u), mapTuple42 f (x, y, z, u) = (x, f y, z, u).
But it looks natural to have such functions for tuples in the library. As Haskell-2010 has zip3, zip4 ..., where are the library functions tupleij, setTupleij, mapTupleij, say, for i, j <- [2 .. 6] ? I expected to find in the Report "Data.Tuple" similar as "Data.List", but do not. GHC has "Data.Tuple", but it misses the above functions.
Thank you in advance for your comments,
----------------- Serge Mechveliani mechvel@botik.ru
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (1)
-
Christian Höner zu Siederdissen