aboutsummaryrefslogtreecommitdiff
path: root/Pretty.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Pretty.hs')
-rw-r--r--Pretty.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Pretty.hs b/Pretty.hs
new file mode 100644
index 0000000..f2f36d8
--- /dev/null
+++ b/Pretty.hs
@@ -0,0 +1,14 @@
+module Pretty where
+
+import Data.List
+
+
+class Pretty a where
+ pretty :: a -> String
+ pretty = prettyI 0
+
+ prettyI :: Int -> a -> String
+
+
+instance Pretty a => Pretty [a] where
+ prettyI i l = "[" ++ intercalate ", " (map (prettyI i) l) ++ "]"