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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.153.78 with SMTP id ve14mr37463216pab.44.1447778599864; Tue, 17 Nov 2015 08:43:19 -0800 (PST) X-Received: by 10.182.144.200 with SMTP id so8mr394563obb.5.1447778599829; Tue, 17 Nov 2015 08:43:19 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no4315704igv.0!news-out.google.com!f6ni5417igq.0!nntp.google.com!i2no4315702igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 17 Nov 2015 08:43:19 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.216.245.129; posting-account=21X1fwoAAABfSGdxRzzAXr3Ux_KE3tHr NNTP-Posting-Host: 82.216.245.129 References: <14533506-4289-4148-b8c4-e970f5778b26@googlegroups.com> <87si45msuz.fsf@nightsong.com> <35d6dc4f-4f2e-4e75-925c-e4acc7c8f112@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <76ea0bc9-537b-4c68-a728-4f634cf6de52@googlegroups.com> Subject: Re: Haskell, anyone? From: Hadrien Grasland Injection-Date: Tue, 17 Nov 2015 16:43:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28420 Date: 2015-11-17T08:43:19-08:00 List-Id: Le mardi 17 novembre 2015 13:01:24 UTC+1, G.B. a =E9crit=A0: > > the horrors of recursion >=20 > Recursion, I speculate, is one of the two things that > a programmer new to FP style needs to learn, the other > being combinatorial control of the evaluator's mechanics. > It is like learning how to write assembly programming, > with one difference: the "paper" is turned by 90=B0 > and FP is a little less explicit about instructing the > machine.(*) I would say that recursion is the goto statement of functional programming = languages : necessary in order to achieve Turing-completeness, and occasion= ally useful, but makes control flow messy and programs very difficult to re= ason about, and should thus only be used in situations where no higher-leve= l abstraction will fit. The recursive hoops that one has to jump through in order to "modify" a com= plex data structure are especially gruesome. Just implemented a radix tree = in OCaml today, as an exercise, and the insertion function gave me a glimps= e of what FP hell looks like. Sometimes, immutability can really make thing= s much worse. I enthusiastically approve of the creative uses that FP languages find to d= iscriminated types, though. It gives me plenty of ideas to experiment with = in my future Ada programs.