Re: tuple component functions

2003-01-03 Thread Ketil Z. Malde
[EMAIL PROTECTED] writes: S.D.Mechveliani writes: As Haskell has the standard functions fst, snd to decompose (a,b), maybe, it worths to provide also [...] I've found some of these useful, except I named them differently: fst3 :: (a,b,c) - a snd3 :: (a,b,c) - b thd3 :: (a,b,c) - c

Re: tuple component functions

2003-01-03 Thread Nils Decker
[EMAIL PROTECTED] (Ketil Z. Malde) wrote: I'd like a general 'nth', but of course that would restrict us to monotyped tuples (e.g., nth :: Int - (a,a,...,a,a) - a ) Under [1] you find an interesting proposal for Template Haskell. I don't know, how far it is from beiing

Re: tuple component functions

2003-01-03 Thread Wolfgang Jeltsch
Hi! [...] twin :: a - (a,a) twin x = (x,x) By using the Monad instance of ((-) a), defined in Control.Monad.Reader, one can write join (,) for twin. (And, by the way, one can use join for functions in several other useful ways. For example, one can write join (*) for a squaring

long delayed messages [was Re: tuple component functions]

2003-01-02 Thread Tim Barbour
Vinicius Callegari writes: [...] Tim, watch out, your date is in the past. You messages might not be read... Thanks for the warning. The messages were indeed sent in the past, and took an unusually long time to be delivered! Apparently a few messages got queued somewhere by my MTA (perhaps

RE: tuple component functions

1999-09-16 Thread Mark P Jones
| 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 =

Re: tuple component functions

1999-09-16 Thread Bruno Barbier
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

Re: tuple component functions

1999-09-16 Thread Keith Wansbrough
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 ?

Re: tuple component functions

1999-09-16 Thread Jon . Fairbairn
On 16 Sep, Keith Wansbrough wrote: I suggest calling them "pi13" or "prj13" rather than "tuple31", though. pi1_3 or proj1_3 or select_1_3 or sel_1_3, even s_1_3 -- omitting the "_" means sel is ambiguous (!). We should choose a scheme that can cope with such things even if they are

Re: tuple component functions

1999-09-16 Thread Ron Wichers Schreur
Jón Fairbairn wrote (to the Haskell mailing list): pi1_3 or proj1_3 or select_1_3 or sel_1_3, even s_1_3 -- omitting the "_" means sel is ambiguous (!). We should choose a scheme that can cope with such things even if they are unlikely. I don't think pi_m_n looks right unless you