|
> Pure functions are pure, yes, but you can have impure functions Not in Haskell, you can't. > Haskell is only interesting because you can have impure functions No, it's interesting because it provides a way of representing series of effectful operations that are distinct from its functions, which are pure. > otherwise every Haskell program would compile down into a constant Every program in any language that is compiled compiles down to a constant (which is, itself, usually a program, often an imperative one in a native or virtual machine language); but in Haskell, each program is (in the model of the language, not merely what they compile to) normally a constant, non-function expression, most commonly of type IO (). It's true that values of type IO a are isomorphic to “impure nullary functions returning a” in a language which has impure functions, but they aren't functions in Haskell, and can't be called from functions, they can only be operated on as values within the language. |
> Every program in any language that is compiled compiles down to a constant ...
Sigh, yes, the compiled program is constant, but you know what I meant: a constant value, such as a number, that the program is expected to output. Let's not be this pedantic.