Re: Curry syntax

From: Wolfgang Lux <wolfgang.lux_at_gmail.com>
Date: Thu, 9 Mar 2017 23:37:46 +0100


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

<shameless-plug>
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.
</shameless-plug>

Wolfgang
_______________________________________________
curry mailing list
curry_at_lists.rwth-aachen.de
https://mailman.rwth-aachen.de/mailman/listinfo/curry

Received on So Mär 12 2017 - 18:42:53 CET

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:12 CET