
16 Mar
2010
16 Mar
'10
5:09 a.m.
Hi Szilveszter zipWith is probably what you are after...
zipWith Stuff nums strs [Stuff {aNum = 123, anStr = "qwe"},Stuff {aNum = 321, anStr = "asd"},Stuff {aNum = 345, anStr = "zxc "}]
Note zipWith (and the function zip which it generalizes) go 'short' - i.e. if one of the input lists is shorter than the other - the size of the result list will the size of of the shorter one:
zipWith Stuff [1] strs [Stuff {aNum = 1, anStr = "qwe"}]
Best wishes Stephen