Re: Curry Report Vers. 0.8.2

From: Wolfgang Jeltsch <wolfgang_at_jeltsch.net>
Date: Wed, 22 Mar 2006 17:56:01 +0100

Am Mittwoch, 22. März 2006 10:35 schrieben Sie:
> Wolfgang Jeltsch wrote:
> > Am Montag, 20. März 2006 17:09 schrieb Wolfgang Lux:
> >> [...]
> >>
> >> There is a more important reason for using two different
> >> primitives for equality and ordering: For some types it is
> >> possible to check equality, but they do not have a natural
> >> ordering. For instance, MCC supports equality tests for
> >> partial applications (which seems natural given that they
> >> can be used in equality and disequality constraints), file
> >> handles, and also mutable references in the IO monad. However,
> >> compare will report an error at runtime when applied to
> >> arguments of these kinds.
> >
> > Brrr, runtime errors! Seems like Curry badly needs type classes. :-)
>
> Brrrr, also.
> Somehow this argument does not convince me. There are a lot of types,
> which have no "natural order", even if they have a representation as
> user defined data types. And because we have no type classes, we impose
> a conventional order on them. The same would be possible for functions.
> And by the way, IF we had type classes it might still be debatable
> whether functions should be of class Eq (and also of class Unifiable, or
> whatever we would call those usable in constraints.) Neither way, I do
> not see why a "runtime error" is in any sense better, neither "more
> natural" nor "making more sense". And does the equality on IORefs or
> file handles make more sense than an arbitrary ordering does? I don't
> see why. In contrast, I was asked only a few days ago, how it might be
> possible to have an arbitrary ordering on IORefs (in order to avoid
> deadlocks in distributed access to them).

I don't quite understand your argument. Do you argue against my point or not?
I wanted to say that with type classes we would be able to decide for which
types we want to define orderings and would be able to check at compile time
whether comparisons take place only with types which have an ordering defined
for them.

> Greetings
> Bernd

Best wishes,
Wolfgang


_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mi Mär 22 2006 - 18:34:46 CET

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