|
|
|
|
|
by willtim
3247 days ago
|
|
Now you have the condescending tone! However, it appears you don't understand the IO monad. Programming using the IO monad is pure functional programming with full referential transparency. Please read Phil Wadler's paper, you will not understand this from that JavaScript snippet. The only backdoors are escape hatches like unsafePerformIO which are used for low-level libraries and FFI, they can be disabled with pragmas and/or compiler switches. It is much harder to stay true to that definition using the other languages, multi-paradigm or not. That is why Haskell is so often mentioned in the context of FP. |
|
--- treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. ---
> It is much harder to stay true to that definition using the other languages, multi-paradigm or not.
I doesn't matter if it's "hard". Your argument was that "Only Haskell strictly conforms to that definition."
No. Haskell conforms stricter. It doesn't mean that none of the other languages are not FP, or cannot be used to program in functional style.
> That is why Haskell is so often mentioned in the context of FP.
Yes. And the problem is that people treat the features that Haskell has as requirements to be considered a functional programming language.
- Typeclasses/Liquid types/Dependent types are not FP
- Pattern matching is not FP
- Laziness is not FP
- A whole bunch of anything else is not FP