[clean-list] Overlapping discriminated instances without type aliases does not work

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


why

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

does not work (`multiply defined`), but

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

works ok (1,2)?


More information about the clean-list mailing list