Re: Curry Report Vers. 0.8.2

From: Sebastian Fischer <sebf_at_informatik.uni-kiel.de>
Date: Mon, 20 Mar 2006 09:28:51 +0100

Michael Hanus wrote:

>> From our experience, every new primitive, in particular
> recursion operators like =:=, == etc., requires considerably
> effort not only for the language implementation but also
> for various tools like debuggers, profiles, analyzers etc.
> Thus, I am in favor to avoid such primitives whenever possible.
>
>> Furthermore, it is nice having a data type Ordering in the prelude,
>> but it would be more useful if there were also a compare function
>> using
>> this type and it would be even more useful if this function had a
>> polymorphic type signature, i.e.
>> compare :: a -> a -> Ordering
>
> Ok, added.

We could define (==), (<), (<=), (>) and (>=) in terms of compare.
After that e.g. the functions List.leqList, List.leq.Char and
List.leqString could all be defined as (<=). Or is there a reason to
provide a compare function for arbitrary datatypes and restrict
compare predicates to Int?

Best Regards,
Sebastian

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mon Mar 20 2006 - 10:00:20 CET

This archive was generated by hypermail 2.3.0 : Mon Sep 16 2019 - 07:15:05 CEST