Re: Curry Report Vers. 0.8.2

From: Michael Hanus <>
Date: Mon, 20 Mar 2006 12:20:57 +0100

Sebastian Fischer wrote:
> Michael Hanus wrote:
> 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?

No, I don't think there is a good reason.

Thus, I'll define the comparison functions
(<), (<=), (>) and (>=) in terms of compare in the prelude
as already done in the Muenster Curry Compiler.
However, I'll keep the definition of (==) as a primitive
(like in the MCC) since its direct implementation is a bit
more efficient than compare and it is often used in programs.
Furthermore, in terms of this discussion, I think it makes
also sense to define min/max in the prelude by

max :: a -> a -> a
max x y = if x >= y then x else y

min :: a -> a -> a
min x y = if x <= y then x else y

Best regards,


curry mailing list
Received on Mo Mär 20 2006 - 12:44:19 CET

This archive was generated by hypermail 2.3.0 : Mo Okt 26 2020 - 07:15:03 CET