zipWith, zipWith3, zipWith4.... looks gawky, IMHO

Coeus@gmx.de Coeus@gmx.de
Tue, 20 Aug 2002 12:08:52 +0200 (MEST)


> Nice, except that operator names that start with ':' are constructors.
> 
> Have you seen the paper "Do we need dependent types"
> <http://www.brics.dk/RS/01/10/>?  They do the same trick, and go
> further.
> 
> --Dylan
> 

No; but now I have it.

I do not know where to use zipWith8 instead of operators.

- Marc

P.S.: AddOn

(:<) :: (a->b) -> [a] -> [b]
(:<) :: map

(><) :: [(a->b)] -> [a] -> [b]
(><) (f:fs) (a:as) = f a : ( fs >< as )
(><) _ _ = []

(><*) :: [(a->b)] -> a -> [b]
(><*) (f:fs) a = f a : ( fs >: a )
(><*) _ _ = []

to use it in sth like...
concat $ ("("++) :< map ((++).show) is ><* ("|"++) >< map ((++).show) js ><*
"\n"
(I did not test it)