
5 Jun
2011
5 Jun
'11
11:09 a.m.
Hi folks, I am working my way through "Learn You a Haskell for Great Good" and have reached page 84, where the book recommends that you define your functions in a "points-free style", using the "." and "$" operators. Now I have: sumProducts' :: Num a => [a] -> [a] -> a sumProducts' x y = sum (zipWith (*) x y) I would like to eliminate the "x" and the "y" in the definition, but all I have managed to contrive is: sumProducts :: Num a => [a] -> [a] -> a sumProducts x = sum . zipWith (*) x How do I proceed from here? Any advice is welcome :) Many thanks in advance, /Alexander