Wolfgang Lux schrieb:
> Bernd Brassel wrote:
>
>> Without wishing to open up an old topic again: What were the reasons
>> to make seq rigid? Why should it not correspond to head normal form?
>> You could always define the old seq as
>> oldseq x y = case x of _ -> y
>> or does that taste too much like a hack?
>
>
> No, not like a hack, but it will not work as you expect. The expression
> case x of _ -> y is equivalent to let _ = x in y and since there is no
> demand for x in that expression, it simply does not evaluate x at all.
>
Ah yes, you are totally right. I was mislead by the treatment of case in
the operational semantics: first compute hnf and then look for pattern
matches. Of course in the operational semantics, there is no underscore.
Thus, I agree now that we need a primitive to introduce the behaviour
formally known as rigid branching. I would like to discuss the name,
however.
"rigid" is in my opinion understandable only in the contrast to
"flexible". As there is no dual function to the new primitive, I would
like to see it called differently. Here are a few suggestions:
1) waitOn - nicely expresses the identity on its argument but might
be too operational (on the other hand, we would like to influence only
operational behaviour with it)
2) suspendOn - similiar
3) groundVal - returns the ground value of its argument, (not a
predicate as it is not called isGrundVal). Might sound like it should
compute what ground does in Wolfgangs former mail:
> function ground :: a -> a, which (again lazily) ensures that its result
> is a ground term
so maybe rather:
4) groundHnf - returns the ground head normal form of its argument
5) binding - returns the binding of its argument
What do you think of these (or others)?
Greetings,
Bernd
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mi Nov 10 2004 - 11:09:30 CET