lib for tuples
Christian Höner zu Siederdissen
choener at tbi.univie.ac.at
Tue Jan 4 13:33:36 CET 2011
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 <mechvel at botik.ru> [04.01.2011 11:29]:
> 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 at botik.ru
>
>
>
>
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20110104/4fa81513/attachment.pgp>
More information about the Glasgow-haskell-users
mailing list