[Haskell-cafe] Re: Why purely in haskell?
barsoap at web.de
Wed Jan 9 09:57:39 EST 2008
"Yu-Teh Shen" <shenyute at gmail.com> wrote:
> I got question about why haskell insist to be a purely FL. I mean is
> there any feature which is only support by pure?
> I mean maybe the program is much easier to prove? Or maybe we can
> cache some value for laziness.
> Could anyone give me some more information about why haskell needs to
> be pure.
To give a short answer: Because if pureness would be abandoned for easy
implementation of feature X, features Y and Z would become completely
The pureness is an ideological design decision basing on the
assumption that pureness is ideal to ensure whole-system consistency.
Most important is referential transparency, its lack of spooky
side-effects and thus making global memoization of evaluation results
In fact, the most obvious point really seems to be that
getChar :: Char
cant' be cached, though its type implies it,
getChar :: IO Char
enshures that only the _action_ of getting a char can be cached, not the
char itself. (and asking why and how the IO type does that opens a big
can of worms)
It's along the lines of "a value is an unary, static function that
returns a value" vs. "an input function is an unary, dynamic function
that returns a value" and the proper handling of the terms "static" and
"dynamic" in every possible case.
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
More information about the Haskell-Cafe