Thankyou Autrijus for clarifying what I was (clumsily) trying to say.

Once you accept that side-effects are impossible to avoid, you can conceal them, segregate them, and move them to other places, but you cannot avoid them. You have to deal with them.

The distinction between Haskell (and FP languages in general) and imperative languages (exempified by Perl), are in how you choose to deal with them.

My only statement that could be considered "against" Haskell, is that personally, I prefer the permissive syntax and semantics of Perl as my tool for doing so, than I do, (what I consider to be, in my admittedly breif experiences of them), the restrictive syntax and semantics of Haskell and other FP languages.

That is a biased viewpoint. In part by my greater experience with imperative langauges in general and Perl in particular. In part, by my feelings and opinions regarding the barrier that is formed between the general (and even the programming) population by viewing the world through opaque glasses of mathematical notation.

I see the need for mathematical notation. Just as I believe that it is necessary for programmers to read, understand and use the full expressive power of their chosen computer languages, so I see that for the mathematician, the short-hand of math notation is their tool that allows them to express and convey (to other equally conversant practitioners) their ideas and concepts.

But, just as the artist has no need for the constraints and precision of the draughtsmans tools to express and encapsulate his/her ideas, I don't think that the programmer needs the tools and nomenclature of the mathematician to express and encapsulate theirs.

It may be mathematically correct to view the length of a string as a recursive function that processes the string as a list of characters counting them until the list is empty. And it may well be that a compiler can optimise this operation to the point where the counting is only ever done once. And the fact that the compiler actually reduces the operation to storing the length, as state in concert with the string, and adjusts it whenever the length of that string changes, whether through visible or concealed side-effect, is actually exactly what Perl does. It just advertises that fact rather than conceals it.

At the final analysis, it comes down to which syntax you prefer to use. Through my inherent bias, which we all have, I prefer the imperative view of the world to the functional. I find it more natural.

But my preference, nor my stating of that preference on this site, dedicated as it is to Perl, in no way belittles the power of FP, anyones preference for FP, or the frankly awe-inspiring use you have made of that power to the good of Perl.

I am in awe. Of it, and you, and the use you have made of it.

You have my thanks for your work and the benefits that it has already accrued and continues to accrue to the future of Perl.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

In reply to Re^5: GHC shuffle more efficient than Perl5. by BrowserUk
in thread Why is the execution order of subexpressions undefined? by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.