3 ms·
> In Haskell impure functions are fenced off from pure functions That's a great way of explaining it. But at the same time how can we say that Haskell is a "pu
by galaxyLogic 6y ago
> In Haskell impure functions are fenced off from pure functions
That's a great way of explaining it. But at the same time how can we say that Haskell is a "pure functional language" when Haskell programs consist of both pure and impure functions?
Yes they are separated which in other words means you do have both of them. Is that really "pure" then? Or is that more like 'as pure as possible"?
- mejutoco 6y agoAccording to this definition a pure programming language could not have any side effect (Not very useful). Maybe as pure as possible is the only interpretation that makes sense, then.
- whimsicalism 6y agoAgreed - I do not think purity should be core to the definition of what a functional language is.
- flowerlad 6y agoPure functions (with no side effects or state mutation) is pretty core to functional programming.
- whimsicalism 6y agohttps://en.wikipedia.org/wiki/Functional_programming https://en.wikipedia.org/wiki/Functional_programming > Functional programming is sometimes treated as synonymous with purely functional programming, a subset of functional programming which treats all functions as deterministic mathematical functions, or pure functions. When a pure function is called with some given arguments, it will always return the same result, and cannot be affected by any mutable state or other side effects. It is a closely associated idea, but it is not necessarily "core" to what FP is.