diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-08-19 11:05:43 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-08-19 11:05:43 +0200 |
commit | 694ec05bcad01fd27606aace73b49cdade16945e (patch) | |
tree | 5c7a0433232f0860ef18f1634510d4f823ce5bdb /Pretty.hs |
Initial
Diffstat (limited to 'Pretty.hs')
-rw-r--r-- | Pretty.hs | 14 |
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) ++ "]" |