[Haskell-cafe] Stupid question, re: overloaded type classes

Ryan Ingram ryani.spam at gmail.com
Sun Jan 18 15:47:06 EST 2009

On Sun, Jan 18, 2009 at 12:43 PM, sam lee <skynare at gmail.com> wrote:
> The following code compiles fine on my ghci

This seems like a bug, you didn't enable overlapping instances and
these two instances clearly overlap:

>    instance Sexpable String where
>    instance Sexpable a => Sexpable [ a ] where

since String is a synonym for [Char].  Although maybe overlapping
doesn't get checked until you use the instance?  Try adding this line:

> test = toSexp "hello"

   -- ryan

  -- ryan

More information about the Haskell-Cafe mailing list