[Haskell-cafe] List manipulation

Henning Thielemann lemming at henning-thielemann.de
Wed Jan 26 12:12:58 EST 2005


On Wed, 26 Jan 2005, Luca Marchetti wrote:

> Hi
>
> why don't you try something like this:
>
> map (\(x,y) -> x+y) (zip [1,2,100] [2,3,500])
>
> list comprehension would sum every element of the firs list with every
> element of the second.

If 'zipWith (+)' doesn't satisfy you, what about
  map (uncurry (+)) (zip [1,2,100] [2,3,500])
 ?

B-]



More information about the Haskell-Cafe mailing list