Re: Proposal: Lazy matching for local patterns

From: Mario Rodriguez-Artalejo <>
Date: Wed, 24 Oct 2001 11:51:52 +0200

Dear all,

Wolfgang Lux writes:

>the semantics of purely functional programs in Curry is mostly similar
>to that of Haskell (except for the handling of overlapping rules).
>However, there is one major difference, which results in valid Haskell
>programs to fail under Curry: The lifting algorithm given in appendix
>D.8 of the report is too strict wrt local patterns. E.g. consider the

I agree with Wolgang that a less strict lifting algorithm would be better,
in order to achieve succesful computations in those cases where Haskell does
so. However, I have a comment about the alternative translation which
Wolgang proposes to eliminate local pattern declarations. It seems to me
that the translation does not work in the case of recursive local definitions.
Consider for example the definition

   f x = let {xs = x:xs} in head (tail xs)

In Haskell, (f 0) evaluates to 0, while the translation proposed by Wolgang
cannot be applied because free (x:xs) is not a subset of free (f x).

Maybe the translation is not meant to be used for recursive local definitions.
If this is the case, just forget about the comment.

Best Wishes,



* *
* Donate Food for Free to Hungry People * * *
* Visit The Hunger Site: *
* *
* *
* *

               In this world, up to the present time,
               hate has never dispelled hate.
               Only love can dispel hate: this is the law.

Prof. Mario Rodriguez-Artalejo e-mail:
Dpto. de Sistemas Informáticos y Programación Fax: +34 91 3 94 46 07
Universidad Complutense de Madrid Phone: +34 91 3 94 45 12
Edificio de la Facultad de Matematicas
Av. Complutense s/n
E-28040 Madrid, Spain

curry mailing list
Received on Mi Okt 24 2001 - 11:56:47 CEST

This archive was generated by hypermail 2.3.0 : So Dez 03 2023 - 07:15:07 CET