Sebastian Hanowski wrote:
>
> That's a very descriptive coding of need-time-choice non-determinism.
> But it also imposes a finiteness restriction on the argument, for
> example it won't give us
>
> Tree (Tree Color)
Yes, that's it! I should have read this one before replying to Sergio's
mail.
> _at_Bernd Brassel:
>> type Generator a = () -> a
>>
>> Tree :: Generator a -> Generator (Tree a)
>> Tree a _ = Leaf ? Node (a ()) (Tree a ()) (Tree a ())
>
> That seems to do the trick. But it looks like it's done in call-by-value
> languages, delaying the evaluation of an expression by hiding it under a
> lambda. Maybe that's why I didn't come to think of doing this with
> call-by-need Curry.
> I had just liked to shove the overhead of wrapping arguments with
> functions once and forall from application to definition.
Wolfgang lux once proposed a function "clone" in this mailing list. This
was essentially the function you would need to use Sergio's scheme and
get the result you want. And the kics compiler, which release is soon to
be announced here, has a mode in which free variables are implemented
this very same way.
Greetings
Bernd
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Dez 11 2006 - 10:15:55 CET