Hi All,
Although not prolog based. I'm trying to write a function in Haskell 'prod lst1 lst2' which sums the products of corresponding elements of two lists. e.g
prod [1,2,3] [4,5,6] = 1*4 + 2*5 + 3*6 =32
I'm think the 'map' function is to be used but i dont know how to implement the function. Any help on this will be greatfully appreciated.
Cheers,
Trint
Although not prolog based. I'm trying to write a function in Haskell 'prod lst1 lst2' which sums the products of corresponding elements of two lists. e.g
prod [1,2,3] [4,5,6] = 1*4 + 2*5 + 3*6 =32
I'm think the 'map' function is to be used but i dont know how to implement the function. Any help on this will be greatfully appreciated.
Cheers,
Trint