[Haskell-cafe] On the purity of Haskell

Chris Smith cdsmith at gmail.com
Fri Dec 30 21:28:36 CET 2011


On Fri, 2011-12-30 at 23:16 +0200, Artyom Kazak wrote:
> Thus, your function “f” is a function indeed, which generates a list of  
> instructions to kernel, according to given number.

Not my function, but yes, f certainly appears to be a function.

Conal's concern is that if there is no possible denotational meaning for
values of IO types, then f can't be said to be a function, since its
results are not well-defined, as values.

This is a valid concern... assigning a meaning to values of IO types
necessarily involves some very unsatisfying hand-waving about
indeterminacy, since for example IO actions can distinguish between
bottoms that are considered equivalent in the denotational semantics of
pure values (you can catch a use of 'error', but you can't catch
non-termination).  Nevertheless, I'm satisfied that to the extent that
any such meaning can be assigned, f will be a valid function on
non-bottom values.  Not perfect, but close.

-- 
Chris Smith




More information about the Haskell-Cafe mailing list