[clean-list] More generic instance always preferred instead of most specialized

Vag vag.vagoff at gmail.com
Sat Jun 27 03:27:50 MEST 2009


why

Start = (C (D '1'),C (D 1))
:: D a = D a
:: T :== D Char
instance C (D a) where C (D a) = D a
instance C T where C _ = D '_'
class C a :: a -> a

and

Start = (C (D '1'),C (D 1))
:: D a = D a
:: T :== D Char
instance C T where C _ = D '_'
instance C (D a) where C (D a) = D a
class C a :: a -> a

both gives ((D '1'),(D 1)) but not ((D '_'),(D 1))?


More information about the clean-list mailing list