trb | 18 Sep 1999 09:08
Picon

tuple component functions

S.D.Mechveliani writes:
 > 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 ?

I've found some of these useful, except I named them differently:

> fst3 :: (a,b,c) -> a
> fst3 (x,_,_) = x

> snd3 :: (a,b,c) -> b
> snd3 (_,x,_) = x

> thd3 :: (a,b,c) -> c
> thd3 (_,_,x) = x     

.... never got around to quadruples etc.

I also defined (some of these may be untested):

> tripl :: a -> (a,a,a)
> tripl x = (x,x,x)

> curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
> curry3 f x y z =  f (x, y, z)

(Continue reading)

trb | 19 Sep 1999 09:36
Picon

ICFP programming contest

Michael Hobbs writes:
 > Just took a look at the results for the ICFP contest. Am I correct in
 > assuming that "LA" stands for Lennart Augustsson and that "Si^3" stands
 > for Simon Marlow, Simon Peyton-Jones, Sigbjorn Finne?

Is there a URL for the results ?

Tim

Gmane