> > infixl 7 *$
> > infixl 6 +$, -$
> > class Ring a where
> >  (+$), (-$), (*$) :: a -> a -> a
> >  negateR :: a -> a
> >  fromIntegerR :: Integer -> a
> >  zeroR, oneR :: a
> 
> It's particularly irritating having to use many of the Num methods and   
> therefore having to give them different names.

Suggestion: use qualified imports:

        module Structures where
        import Prelude hiding( Num(..) )

          class Ring a where
            (+) :: a -> a -> a 
            ...etc...

          instance Ring Integer where
            (+) = (Prelude.+)
            ...etc...

When you import Structures elsewhere you must either import it
qualified, or else hide Num(..) from the Prelude, so that "+"
always means exactly one thing.

I'n not sure whether this module jiggery pokery works in Hugs,
but it does in GHC.

Simon


Reply via email to