Re: Curry syntax

From: Andy Jost <>
Date: Thu, 9 Mar 2017 16:42:20 +0000

Yes, this is syntactic sugar only. The reason I thought of it: I was trying demonstrate in an introductory way how easy it is to produce a constrained value in Curry. But using &> forces me to explain success and failure, and introduces a "funny" operator. In the end, I felt the demonstration would only give the impression that this sort of thing is technical and complicated, not simple and intuitive like I had hoped.


-----Original Message-----
From: Michael Hanus []
Sent: Thursday, March 9, 2017 2:29 AM
To: Wolfgang Lux <>; Andy Jost <>
Cc: curry_at_lists.RWTH-Aachen.DE
Subject: Re: Curry syntax

On 03/09/2017 09:25 AM, Wolfgang Lux wrote:
>> Am 08.03.2017 um 19:46 schrieb Andy Jost <>:
>> I wonder if anyone has ever thought about allowing a “where” clause with conditions in a Curry expression. For instance, I wish this were a valid expression:
>> (x where length x == 3)
>> (I also like to assume unbound variables are free, but that’s a
>> different topic.)
>> Any thoughts?
> Isn't this already possible with (length x == 3 &> x) in Curry now?
> Or am I missing something?

I also thought of the same construction.

There is still one issue to discuss: the scope of x.
If x should be visible like any other object introduced in a where clause, one can write it as

  where x = let x free in length x == 3 &> x

Best regards,


curry mailing list

Received on Do Mär 09 2017 - 18:45:09 CET

This archive was generated by hypermail 2.3.0 : Sa Dez 09 2023 - 07:15:14 CET