Dear people,

i cannot tell, whether the following is a particular implementation
bug or it is against Haskell-98:

  class Rs r where  toRs :: r a -> a -> r a

  data (Num a)      => Rsi a = Rsi a a
  data (Integral a) => Rse a = Rse a a

  instance Rs Rsi where  toRs (Rsi _ b) a = Rsi (a-b)     b
  instance Rs Rse where  toRs (Rse _ b) a = Rse (rem a b) b

It wants to say, that  toRs  implements differently for several
constructors.
As Rsi is declared to presume the  Num a  context,
has Haskell to accept `a-b' in the instance for Rsi ?

If it has not, then this reduces the language expressiveness ...
How to fix this?

Thank you in advance.


------------------
Sergey Mechveliani
[EMAIL PROTECTED]


Reply via email to