Re: Proposal for syntax changes in Curry
Hello Michael,
I have a few remarks to your proposal.
First I do not see the reason why you want to restrict the expression
inside a
let ... free in exp
to the type of constraint.
Second I am very unhappy about your proposal concerning conditional
expressions. I had liked the idea of interpreting conditional
expressions with only boolean guards as an abbreviation for nested if
expressions on the rhs very much, esp. as this interpretation is also
compatible with Haskell. However there was a clear syntactic criterion
when this interpretation applied.
With your new proposal things get really bad, however, because now
there is no syntactic distinction between the two cases. E.g. consider:
f x = x <= 2
g x = x == 1
h x | f x = 1
| g x = 2
The result of the reduction h 1 will always be 1. Now if I change the
definition of g to
g x = x =:= 1
(and this might be in a completly different part of the program) I now
get as result of h 1 the disjunction 1 | 2. (With the old syntax I
would have got a type error telling me that g x is not of type Bool.)
So I would suggest either dropping the change in semantics for (only)
boolean guards in a conditional expression or still use braces around a
constraint expression the guard of a conditional expression. The latter
will not conflict with Haskell, as a record can never appear in a guard
expression.
Regards
Wolfgang
P.S.: Just out of curiosity. What is the reason for replacing /\ by &?
I've just got accustomed to typing /\ :-)
Received on Do Okt 22 1998 - 17:40:00 CEST
This archive was generated by hypermail 2.3.0
: Do Jun 20 2024 - 07:15:05 CEST