Re: Proposal for syntax changes in Curry

From: Herbert Kuchen <kuchen_at_uni-muenster.de>
Date: Fri, 23 Oct 1998 13:40:16 +0100

Michael Hanus wrote:

> Wolfgang Lux wrote:
> > 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.
>
> This restriction is due to semantical reasons. Since "let...free"
> corresponds to existential quantification, it is natural to
> have it in constraints, but I do not know what is the semantics
> of a term like "there exists an x such that x+2".

I agree that forcing exp to be of type Constraint is probably
too restrictive. It might be interesting to allow

let ... free in exp

also with other types of exp, e.g. in

let x free in parent x

parent Bill = Maud
parent Maud = Jack

it could be used to generate possible values.


> Sven Panne wrote:
>
>
> > [...]
> > 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.)
>
> IMHO, that's not a problem.
>
I also think that this not a serious problem, and
that it is better than a special syntax for constraints.

> > 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.
>
> No! Please nuke the {...} syntax. I've never really understood the
> difference between c and {c}, where c::Constraint.
>
I agree with Sven.

Herbert Kuchen
Received on Fr Okt 23 1998 - 14:48:00 CEST

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