
24 Feb
2015
24 Feb
'15
3:27 a.m.
On 02/23/2015 10:11 PM, Sumit Sahrawat, Maths & Computing, IIT (BHU) wrote:
Hi everyone,
I defined a function for discrete convolution, i.e
conv xs = sum . zipWith (*) xs . reverse
And I was wondering, can it be done without explicitly passing in the xs (eta-reduction)?
Ehhhhhhhhhh this will work: conv = (sum .) . (. reverse) . zipWith (*) But it's so much easier to understand without all the boobies operators: conv xs ys = sum $ zipWith (*) xs (reverse ys)