Re: [Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-09 Thread Stephen Forrest
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

[Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-07 Thread Christian Maeder
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

Re: [Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-07 Thread Jared Updike
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

Re: [Haskell-cafe] Re: Justification for Ord inheriting from Eq?

2006-04-07 Thread ihope
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