instances in Haskell-2

1998-07-29 Thread S.D.Mechveliani
To my request on Haskell-2 ... class (Ring r,AddGroup (m r)) = RightModule m r where cMul :: m r - r - m r -- "vector" (m r) multiplied by "coefficient" r' ... instance Ring r = RightModule r r where cMul = mul Haskell rejects this `= RightModule r

Re: instances in Haskell-2

1998-07-29 Thread Simon L Peyton Jones
I cannot find there the subject. Could you citate? Sorry, it turns out I missed your point entirely. class (Ring r,AddGroup (m r)) = RightModule m r where cMul :: m r - r - m r So here, m :: *-* What you really want is to say instance Ring r = RightModule (\t-t) r where