El Viernes, 12 de Noviembre de 2004 21:23, Wolfgang Lux escribió:
> I don't understand how this would carry over to binary functions,
> in particular if both arguments have different types.
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)).
> I believe that
> in order to make really use of rigidness information, it should
> somehow propagate so that I can see with one look at the function
> mapIO_ whether it suspends or not when applied to an unbound
> variable. Eventually, these annotations should be mixed into the
> type system in a way similar to uniqueness annotations in Clean.
You are absolutely right. I would like to stress there are two parts in my
proposal. The first one is just a sugaring that aims at helping you keep your
code as tidy as possible, without forbidding other uses of the primitive. I
feel that implementing that preprocessing and characterizing a wide range of
"reasonable" uses via the projections is feasible.
The other part is the hard one, of course. I was intentionaly vague in stating
the wish of "tracking down the use of rigidness primitives" because I do not
know whether something as a rigidness type may exist...
Suggestions?
Best,
Julio
> Regards
> Wolfgang
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Nov 15 2004 - 10:03:51 CET