[Haskell] What makes a functional language functional?

C.M.Brown cmb21 at kent.ac.uk
Thu Aug 9 05:30:15 EDT 2007


Hi,

Is lazy evaluation necessary for a functional language to remain
functional?

The reason I ask is that because it violates beta-reduction, and also
referential transparency (I think). In haskell, we can transform:

g x + f x

into:

f x + g x

as both f and g do not change the parameter x.

If g always evaluates to a normal form (in both a lazy and a strict world)

g x = x

but f is defined thus:

f x = (\y -> if x /= 0 then x else y/x)

And we apply f to 0 (1/0) then f becomes _|_

therefore:

0 + _|_ /= _|_ + 0

Or, does this just become:

_|_ = _|_ ?

Or, am I missing something totally obvious?

Regards,
Chris.




More information about the Haskell mailing list