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 autolearn=unavailable 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!.POSTED!not-for-mail From: Mark Carroll Newsgroups: comp.lang.ada Subject: Re: Haskell, anyone? Date: Tue, 17 Nov 2015 09:10:14 +0000 Organization: none Message-ID: <87fv05q9e1.fsf@ixod.org> References: <14533506-4289-4148-b8c4-e970f5778b26@googlegroups.com> <87si45msuz.fsf@nightsong.com> <1h61j5twxf2t2.1dm6v8iu2cpdi$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="1b3e5cba9e4d07a53741e6f3d1717925"; logging-data="11223"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2SDPiEJ5kcIKdMHszIRGR" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:8/VAFL0qUgNiDnvrX+bourBXbeQ= sha1:YeOrjDhLlztlYD2BSthJ+4P1jG0= Xref: news.eternal-september.org comp.lang.ada:28415 Date: 2015-11-17T09:10:14+00:00 List-Id: On 17 Nov 2015, Dmitry A. Kazakov wrote: > On Mon, 16 Nov 2015 15:23:16 -0800, Paul Rubin wrote: > >> Hadrien Grasland writes: > >>> "The compiler and the user are both clever enough". >> >> It's true that there are FP idioms you have to get used to if you're >> coming from imperative programming. > > Because declarative programming is non-algorithmic and no programming at > all, if taken seriously. It is like the idea of stateless programming, just > a fiction. Chris Okasaki's "Purely Functional Data Structures" is a great introduction to the basics of what one can do with algorithms when one takes declarative programming seriously, regardless of if one deems it "non-algorithmic and no programming at all". I do generally find it possible to translate algorithms from books like CLR(S) -- longest common subsequence or directed graph maximum flow or whatever -- to being purely declarative, it just means that I have to step back and really understand the idea and approach of the algorithm, rather than just mechanically translating their for loops and arrays and whatever into the appropriate syntax. For instance, with Haskell the elements of an array of an imperative algorithm may become return values from some recursive lazily evaluated function. (It is still possible to use an imperative approach when it fits best, for instance I often did when translating my simple sysadmin Perl 5 scripts to Haskell.) But I fear we're drifting off-topic so I'll again return to lurking here and look out for any queries in comp.lang.haskell. -- Mark