Re: Evaluation Annotations: are they needed?

From: Bernd Brassel <>
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)
     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
Received on Mo Nov 15 2004 - 11:05:27 CET

This archive was generated by hypermail 2.3.0 : Mi Sep 30 2020 - 07:15:03 CEST