Re: slight differences between non-termination and failure

From: Sebastian Fischer <sebf_at_informatik.uni-kiel.de>
Date: Wed, 02 Feb 2011 18:22:32 +0900

Sorry! The difference is obvious: extend in repeat2 is strict but extend in
repeat3 as well as the local pattern in repeat1 are lazy.

On Wed, Feb 2, 2011 at 6:14 PM, Sebastian Fischer <
sebf_at_informatik.uni-kiel.de> wrote:

> I have simplified the example further:
>
> repeat1 x = x:y:ys
> where
> y:ys = repeat1 x
>
> repeat2 x = extend (repeat2 x)
> where
> extend (y:ys) = x:y:ys
>
> repeat3 x = extend (repeat3 x)
> where
> extend ys = x:ys
>
> Now,
>
> null (repeat1 1)
> null (repeat3 1)
>
> terminate while
>
> null (repeat2 1)
>
> does not.
>
> Sebastian
>



_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mi Feb 02 2011 - 11:42:22 CET

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