Ord instance for Data.Map?

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Tue Apr 17 08:16:53 EDT 2007


Henning Thielemann wrote:
> > > instance Ord x => Ord (Index (Complex x)) where
> > >    (Index (Complex a b)) `compare` (Index (Complex c d)) =
> > >        (a, b) `compare` (c, d)
> >
> > should be good enough. 'Index' marks the purpose for the type.
> 
> That requires extended instance declarations, doesn't it?

Aha. Yes it does. I don't see any simpler workaround than the one
you proposed then, while sticking to Haskell 98.

Thanks,

Bertram


More information about the Libraries mailing list