lib for tuples

Serge D. Mechveliani mechvel at
Tue Jan 4 11:28:13 CET 2011

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 at

More information about the Glasgow-haskell-users mailing list