Re: Curry syntax

From: Andy Jost <>
Date: Fri, 10 Mar 2017 22:34:37 +0000

Hi Wolfgang,

Is there some difference between let bindings and where bindings in this regard? It seems if the functional pattern you show could work in a "let" context, then it should also work in a "where" context. Is this an MCC extension?

I see your points and take them well. I think the nub of my suggestion (which I now see more clearly) is to interpret an expression in a binding context as a constraint. So, something like:

        let length x == 3 in x
        x where length x == 3

There's no use for this in a functional setting, but in Curry it has meaning. I don't know how much the syntax would be disturbed, but it seems possible that ambiguities could be introduced by allowing this.

I think my intuition comes from the "let x free in ..." and "... where x free" constructs. Those already don't bind x, but establish a property regarding it.

Anyway, I don't disagree that this could be a disruptive change.


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

> Am 09.03.2017 um 17:42 schrieb Andy Jost <>:
> 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.

I see what you are trying to get to. My concern is that the where keyword currently introduces a list of bindings, while in your proposal it would be introducing a list of expressions. My feeling is that in the end using where for two different purposes is going to create more confusion than you gain by the new syntax.

Incidentally, you could use function patterns in mcc to achieve (almost) the same effect with a let expression:
  let (length x) = 3 in x
Note that the parentheses around length x are important to make this a pattern binding.


curry mailing list

Received on So Mär 12 2017 - 18:44:08 CET

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