-- way. The 'pretty_print' function then prints the result of
-- 'pretty_show' by default.
--
-module Pretty
+module Pretty ( Pretty(..) )
where
import Text.Parsec ( ParseError )
pretty_print = putStrLn . pretty_show
+-- | If we can pretty print something, we can pretty-print a list of
+-- them too.
+--
+instance (Pretty a) => Pretty [a] where
+ pretty_show l = show $ map pretty_show l
+
+
+-- | If we can pretty print something, we can pretty-print a pair of
+-- them too.
+--
+instance (Pretty a, Pretty b) => Pretty (a,b) where
+ pretty_show (x,y) = show $ (pretty_show x, pretty_show y)
+
+
+
-- | Define a 'Pretty' instance for the result of 'parse'. This lets
-- us pretty-print the result of a parse attempt without worrying
-- about whether or not it failed. If the parse failed, you get the