[clean-list] More transformations

Erik Zuurbier EZuurbier@Abz.nl
Tue, 24 Oct 2000 13:41:47 +0200


Hi,

When Clean will have incorporated support for transformations, will they
also be used for things like the following:

check :: [a] -> Bool
check list = (length list) > 0

I assume that Clean will currently go through the whole list, find out that
it is 2435 elements long, and then decide that 2435 is indeed greater than
0.

In other words, will Clean be triggered to do transformations so that an
optimized version is

check :: [a] -> Bool
check [] = False
check _ = True

even though this new version has different termination behaviour? If that is
the case, will the compiler inform me that it has found an optimization that
makes 'check' work for infinite lists also?

Regards Erik Zuurbier