From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Haskell, anyone? Date: Wed, 18 Nov 2015 12:02:36 +0100 Organization: cbb software GmbH Message-ID: References: <14533506-4289-4148-b8c4-e970f5778b26@googlegroups.com> <87si45msuz.fsf@nightsong.com> <35d6dc4f-4f2e-4e75-925c-e4acc7c8f112@googlegroups.com> <76ea0bc9-537b-4c68-a728-4f634cf6de52@googlegroups.com> <87a8qccxj4.fsf@nightsong.com> <0ff849e9-11d7-438d-abf9-853f79348640@googlegroups.com> <874mgjnctv.fsf@nightsong.com> <87ziyblkzn.fsf@nightsong.com> <937b88b1-66aa-4205-a412-9588d83a3f26@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: TWQ9mg4k1m/sph/eQ+zHLA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28442 Date: 2015-11-18T12:02:36+01:00 List-Id: On Wed, 18 Nov 2015 02:44:02 -0800 (PST), Hadrien Grasland wrote: > For example, if you wanted to explain the factorial to a student who has > never been exposed to the concept, chances are that your first approach > wouldn't be to write on a blackboard > > "fact n = n * fact (n-1) > fact 1 = 1" > > Instead, you would start with a human-readable definition that looks like this : > > "fact n = n * (n-1) * (n - 2) * ... * 2 * 1" Not really. Inductive definitions are all OK, BUT they are not given upside-down, e.g. rather this: 1! = 1 -- Induction basis (n+1)! = (n+1) * n! -- Inductive step or, for that mater, n! = 1 * 2 * 3 * ... * n > In any case, if you are using a machine which can only perform one binary > operation at a time, you will always need an accumulator to compute the > final result. Actually any machine is a FSA. Stateless computation is an oxymoron. The sole reason of having any program running is for the side effects it produces. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de