On 26-Sep-1999, Adrian Hey <[EMAIL PROTECTED]> wrote:
> On Fri 24 Sep, Claus Reinke wrote:
> > >I'm curious. Could you explain exactly what features of Haskell
> > >you think render claims of 'pure functionality' false?
> > 
> > The standard example would be IO. 
> 
> Can you give any other examples?
> 
> The issue I'm thinking about is equational reasoning and program
> transformation. For a lazy (non-strict) language, transformations
> are constrained so that a function definition which is non-strict
> in an argument is never transformed into one which is strict in the
> same argument. (Or so I believe, please correct me if I'm wrong).

Yes (presuming you are talking about semantics-preserving transformations,
of course).

> This seems completely contrary to normal equational reasoning (which is
> one thing functional languages are supposed to support), where we aren't
> so constrained. 

Well, it depends a bit on how you look at it.  But I would say that
with normal equational reasoning, you _are_ constrained to preserve
strictness.  To say that a function is strict in an argument just means
that when you apply that function to _|_, the result is _|_.  Using
equational reasoning, transformations need to preserve properties such
as `f _|_ = _|_' just as much as they need to preserve properties such
as `f 0 = 42'.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.



Reply via email to