[clean-list] strong root normal form

F.S.A.Zuurbier@inter.nl.net F.S.A.Zuurbier@inter.nl.net
Thu, 10 Oct 2002 08:23:30 UT


This is a multi-part message in MIME format.

--_----------=_1034238210257660
Content-Disposition: inline
Content-Length: 1464
Content-Transfer-Encoding: binary
Content-Type: text/plain

Hi Marco

Thanks for the elaborate answer. My problem is not really the normal reduction order, but the strict lets.

When I change a let to a strict let, I think I am saying to Clean: DO it! Actually reduce this! Really! Go on, don't hesitate!

But then there are still cases where the beast does not seem to do anything. I guess because the result was not needed in the function's output. But then, what was the strict let for, as opposed to the 'lazy' let? So now I think it must be something along the following lines.

fun x y
     #! pattern = expression
     = output

Does this mean the following:

"The 'expression' will ALWAYS be reduced, before 'output' is, no matter whether any part of the expression's result is needed in the function's 'output'. BUT the reduction will be pursued only as far as needed to bind all parts of the 'pattern'. This could be NO REDUCTION AT ALL if the pattern is a variable."

Is this close to correct?

I know that turning # into #! can have uniqueness-type consequences. It may change a function from erroneous (type error) to correct. Would it not be nice (wish list?) if the compiler was able to infer #! from # if they are needed to uniqueness-type a function? Just like the compiler is able to infer other kinds of strictness. Yes, I see that there are huge differences. But I think in these cases specified uniqueness types could be read to imply some strictness. Somehow.

Regards Erik Zuurbier
--_----------=_1034238210257660--