[Haskell-cafe] implementing a class using superclasses?

Jade Hagborg jhagborg at quasicoherent.solutions
Wed Mar 26 22:13:29 UTC 2025


On Wed, 2025-03-26 at 18:08 -0400, Jade Hagborg via Haskell-Cafe wrote:
>     instance (Primary a, Secondary a) => Ord (Lex2 a) where
>         compare (MkLex2 x) (MkLex2 y) = comp1 x y <> comp2 x y

My bad (copy-paste error), should be

    instance (Primary a, Secondary a) => Ord (UsePrimaryAndSecondary a) where
        compare (MkUsePrimaryAndSecondary x) 
                (MkUsePrimaryAndSecondary y) = comp1 x y <> comp2 x y

Sorry if that caused confusion.



More information about the Haskell-Cafe mailing list