Jonathan Cast wrote:
instance Show x => Show (Foo x) where
  showsPrec n foo = ("list_foo "++) . shows (foo_list foo)

You use the n parameter if you've got an infix operator in your syntax
and you want to put parentheses around an instance of it if n has the
wrong value (either too high or too low, I can never remember).

OK. So... should the call to shows actually be showsPrec? Or does it not matter in this case?

Actually, now that I think of it, my *next* problem is going to be writing a matching Read instance...

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to