On 4/7/06, Jared Updike [EMAIL PROTECTED] wrote:
given an Ord instance (for a type T) a corresponding Eq instance can be
given by:
instance Eq T where
a == b = compare a b == EQ
where did this second -^ == come from? (I guess if if Ordering
derives Eq :-) I think you meant
I
John Meacham wrote:
1. one really does logically derive from the other, Eq and Ord are like
this, the rules of Eq says it must be an equivalance relation and that
Ord defines a total order over that equivalance relation. this is a good
thing, as it lets you write code that depends on these
given an Ord instance (for a type T) a corresponding Eq instance can be
given by:
instance Eq T where
a == b = compare a b == EQ
where did this second -^ == come from? (I guess if if Ordering
derives Eq :-) I think you meant
instance (Ord T) = Eq T where
a == b = case compare
On 4/7/06, Jared Updike [EMAIL PROTECTED] wrote:
given an Ord instance (for a type T) a corresponding Eq instance can be
given by:
instance Eq T where
a == b = compare a b == EQ
where did this second -^ == come from? (I guess if if Ordering
derives Eq :-) I think you meant