Hello,

I had asked recently why Haskell rejects the declarations

---------------------------------------------------------------------
class  Eq a => N a       where   norm :: a -> Int
 
instance  N a => Ord a   where   x <= y =  (norm x) <= (norm y)
---------------------------------------------------------------------

P.Hudak and W.Partain  - thanks to them !  - noticed that (using my 
words) 
this "Ord" should apply here to the type constructor appied to 
something.  Otherwise the Prelude  Ord  instances overlap with this
one and they may conflict.  I knew this but had somehow oversought.

But there was another letter:

> Did you try other implementations? Gofer accepts it without frowning.


??

I had an idea that Gofer does not allow instances to overlap neither.

Any comments ?


Regards,

Sergey Mechveliani  [EMAIL PROTECTED]



Reply via email to