Thanks.
You've given me a good exercise in equational reasoning.

I'm studying such things because I might start studying combinatory logic (Smullyan's mockingbird book) soon.
It's a good exercise for the mind, and is very enjoyable with pencil & paper.
Can you give me some more patterns like transducers (foldl foldl) and the dot-dot-dot ( boobies, in your words :) ) example?

Thanks once again.

On 24 February 2015 at 08:57, Michael Orlitzky <michael@orlitzky.com> wrote:
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)

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



--
Regards

Sumit Sahrawat