in reply to Re: regex and "Functional Programming"
in thread regex and "Functional Programming"
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.