aboutsummaryrefslogtreecommitdiff
path: root/Pretty.hs
blob: f2f36d8281e295948dd26103ef73c118eae7a4f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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) ++ "]"