I should probably be clear that it is very unpractical to force the "no side-effects" rule in the more broad sense - IO is one area where you're more or less forced to have side-effects - though most side effects occur "outside" the program itself - and most functional programming languages support some kind of modifying function calls (you could probably abuse closures if they don't offer any other way).

This, I think, is a great example of theory vs. practice. In a pure-functional language (like Haskell), there is no way to do I/O without learning about Monads. Which means you need to learn about a fairly advanced functional programming concept just to read data from a file. In a language without this theoretical purity, basic I/O is covered within the first few chapters, and then you move along.

Forcing learning of advanced concepts for simple and common tasks is bad Huffman coding.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.


In reply to Re^2: regex and "Functional Programming" by hardburn
in thread regex and "Functional Programming" by perlcapt

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.