Of Dougal
| Stanton
| Sent: 09 August 2007 16:57
| To: haskell-cafe
| Subject: [Haskell-cafe] Derivation of Eq given Ord
|
| Is there a reason why automatic derivation of Ord without Eq doesn't
| do the sensible thing and just derive Eq anyway?
|
| newtype Id a = Id { a :: String
Dougal Stanton, Thu, 9 Aug 2007 16:57:26 +0100:
Is there a reason why automatic derivation of Ord without Eq doesn't
do the sensible thing and just derive Eq anyway?
newtype Id a = Id { a :: String }
deriving (Read, Show, Eq, Ord)
newtype Ego a = Ego { b :: String }
I would say that qualifies as a bug because it relays an error from compile
time to run time.
Andreas
- Original Message -
From: Dougal Stanton [EMAIL PROTECTED]
To: haskell-cafe haskell-cafe@haskell.org
Sent: Thursday, August 09, 2007 5:57 PM
Subject: [Haskell-cafe] Derivation of Eq
I wrote:
instance Eq Ego = Eq Ord where ...
This should have been
instance Eq (Ego a) = Ord (Ego a)
Malte
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Andreas Marth wrote:
I would say that qualifies as a bug because it relays an error from compile
time to run time.
It doesn't relay anything to run time - ghci has to _compile_ the
expressions you give it too. If you _compile something_ successfully,
you will know that _it_ will not fail in