[Haskell-cafe] Issues(Bugs?) with GHC Type Families

Hugo Pacheco hpacheco at gmail.com
Thu Mar 6 21:30:41 EST 2008


What I said is not true since overlapping instances are not that much
decidable.
Btw, in previous versions of GHC this worked well, but now I suppose order
does not suffices to define instances overlapping

How could I compile such an example, assuming that I want to use the
instance C String for Strings only and the more general instance for the
rest?

class C a where
    c :: a

instance C Char where
    c = 'a'

instance C a => C [a] where
    c = [c :: a,c :: a]

instance C String where
    c = "a"

cc = c :: String

Sorry for the newbie question.
hugo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080307/64dc4dfa/attachment.htm


More information about the Haskell-Cafe mailing list