Re: Evaluation Annotations: are they needed?

From: Bernd Brassel <bbr_at_informatik.uni-kiel.de>
Date: Mon, 15 Nov 2004 11:04:50 +0100

> Well, my example tried to be compliant with the familiar form of
> evaluation
> annotations, but a more flexible syntax can be considered. An
> annotation like
>
> map f eval spineRigid
>
> would desugar every instance of (map f xs) into (map f (spineRigid
> xs)) and,
> more generally, annotations of the form
>
> f eval rp1 ... rpN
>
> would desugar every application (f x1 ... xN) into
> (f (rp1 x1) ... (rpN xN)).

Is it not as easy to write

f = f' (rp x1) ... (rp xN)
   where
     f' <old definition of f>

Why do we need syntactic sugar for this? Anyway it seems to me that you
rarely realy need all of the arguments of a function to suspend on free
variables. It might even lead to unsuspected behaviour. For instance, if
you want to formulate if_then_else, writing

if_then_else eval boolRigid rp1 rp2
if_then_else True x _ = x
if_then_else False _ y = y

would lead to a different behaviour. Or should we be able to write just
if_then_else eval boolRigid, without rp1 and rp2? What if we need only
the second argument to be rigid?

With a rigid primitive we can express all that is needed, and I doubt
whether we should use that primitive so much that sugar will be needed.


_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Nov 15 2004 - 11:05:27 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:07 CEST