[Haskell-cafe] On the purity of Haskell

Chris Smith cdsmith at gmail.com
Fri Dec 30 00:30:17 CET 2011


Sorry to cut most of this out, but I'm trying to focus on the central
point here.

On Thu, 2011-12-29 at 22:01 +0000, Steve Horne wrote:
> In pure functional terms, the result should be equivalent to a fully
> evaluated value - but putStrLn isn't pure. It cannot be fully
> evaluated until run-time.

And here it is, I think.  You're insisting on viewing the performing of
some effect as part of the evaluation of an expression, even though the
language is explicitly and intentionally designed not to conflate those
two ideas.  Effects do not happen as a side-effect of evaluating
expressions.  Instead they happen because you define the symbol 'main'
to be the effect that you want to perform, and then set the runtime
system to work on performing it by running your program.

Evaluation and effects are just not the same thing, and it makes no
sense to say something isn't "evaluated" just because the effect it
describes haven't been performed.  It's exactly that distinction -- the
refusal to conflate evaluation with performing effects -- that is
referred to when Haskell is called a pure language.

-- 
Chris Smith





More information about the Haskell-Cafe mailing list