Re: Proposal: Syntax extension

From: Michael Hanus <>
Date: Thu, 06 Jan 2011 09:48:53 +0100

Sergio Antoy wrote:
> > 2. Non-linear patterns in function declarations: allow multiple occurences
> ...
> Yes. One could also have x==z. Why is x=:=z preferred?
> In true FLP there should be (almost) no residuation. But
> since there is residuation in Curry, all options should be
> considered and the chosen one justified.

Good point. Since function declarations are always flexible
(in contrast to earler versions), I think that matchings
with non-linear left-hand sides should not suspend. If one translates

  f x x = x


  f x z | x=:=z = x

then a call like (f x1 x2) will unify x1 and x2 without suspending
the computation.

The use of x==z would be reasonable for non-linear patterns
in case expressions, as Wolfgang discussed.

Best regards,

curry mailing list
Received on Do Jan 06 2011 - 09:54:57 CET

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