Is it currently (Haskell 1.4) possible to give new instance declarations 
for the class 'String', or am I being silly?

For input like

text :: String -> DOC
class Pretty a where
  showDoc :: a -> DOC

instance Pretty [Char] where
  showDoc s = text s

Hugs gives me this output:

Prelude> :load test.hs
Reading file "test.hs":
Parsing
ERROR "test.hs" (line 7): Type variable expected in instance type
Prelude> 

This seems very inconvenient, if true.  (I suppose I can see the reason: 
otherwise compilers would have to check for overlapping instances.)  Any 
suggested work-arounds?

Thanks,
        Dylan Thurston
        [EMAIL PROTECTED]


Reply via email to