From: Jim Pryor Date: Fri, 17 Sep 2010 01:50:19 +0000 (-0400) Subject: fix multiplication X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=7ef19584ac9af6335037790ce1e59172e0ec14fc fix multiplication Signed-off-by: Jim Pryor --- diff --git a/lists_and_numbers.mdwn b/lists_and_numbers.mdwn index 2f59e263..17b6dfd8 100644 --- a/lists_and_numbers.mdwn +++ b/lists_and_numbers.mdwn @@ -295,12 +295,16 @@ Perhaps not as elegant as addition, but still decently principled. Multiplication is even more elegant. Consider that applying an arbitrary function s to a base value z *m × n* times is a matter of applying s to z *n* times, and then doing that again, and again, and so on...for *m* repetitions. In other words, it's a matter of applying the function (\z. n s z) to z *m* times. In other words, *m × n* can be represented as: -
    \s z. m (\z. n s z) z
-~~> \s z. m n s z
+ \s z. m (\z. n s z) z -which eta-reduces to: +which, doing an eta-reduction and permitting ourselves the `∘` notation, is: + +
\s z. (m ∘ n) s z
+ +and some more eta-reduction gives us: + +
m ∘ n
- m n Isn't that nice?