Re: Curry's Constraint Syntax

From: Michael Hanus <hanus_at_informatik.rwth-aachen.de>
Date: Tue, 10 Feb 1998 16:10:23 +0100

Sven Panne wrote:
> If Curry wants to stay compatible with Haskell, there is a problem
> with Curry's constraint syntax and Haskell's labeled updates:
> ...

Thanks for the hint. It seems that Haskell has occupied
all interesting syntactic constructions related to equality
so that it is difficult to add nicely readable new ones.

Currently, I would like to delay a solution to this problem
since at the current stage it is clear that Curry cannot
be fully compatible with Haskell (also because Haskell is still
evolving). For instance, remember the problem of non-uniform
rules which are allowed in Haskell but make no sense if logic
programming techniques are used. A solution to this incompatibility
is a program transformation which adds some negative conditions
to rules. In the same way, one could think of a transformation
for the record notation. BTW, I am not sure that in a functional
logic language records must be treated as in Haskell. There are
also interesting proposals for records or extensible records
in logic programming where the access to components is
handled as a constraint (maybe this could also be a way to
to solve the above mentioned syntactic problems?).

> To solve this problem, one has to use a different kind of parentheses.
> Propostion: #{ ... } # is an ASCsymbol and therefore a symbol in
> Haskell, but at the moment I don't think that # and { can follow each
> other in a legal Haskell program without intervening space.

Yes, this could be a solution but has a negative influence
on the appearance of constraint programs (but you are right,
think of Wadler's Law of Language Design).

Manuel Chakravarty wrote:
> We had the same problem with Goffin with Haskell 1.4 (as
> Curry's syntax is inspired by Goffin that is not very
> surprising). The latest Goffin paper ``Distributed Haskell:
> Goffin on the Internet'' (to appear in ``Proceedings of the
> Third Fuji International Symposium on Functional and Logic
> Programming''), contains our solution, i.e., a completely
> Haskell compatible syntax, in the appendix.

Ok, it is compatible to Haskell and it is also similar
to the Curry proposal one year ago: you use a three character
symbol for equality (":=:") which I found very ugly when I started
to write programs with it. Moreover, primitive constraints
in choices are enclosed in curly brackets whereas equational
constraints are not. Although it might be appropriate for Goffin,
it is less appropriate for Curry where the choice construct
has deep guards.

Best regards,

Michael
Received on Di Feb 10 1998 - 16:17:00 CET

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