module HSVIS.Pretty where import Data.Void class Pretty a where prettysPrec :: Int -> a -> ShowS instance Pretty Void where prettysPrec _ = absurd instance (Pretty a, Pretty b) => Pretty (a, b) where prettysPrec _ (x, y) = showString "(" . prettysPrec 0 x . showString ", " . prettysPrec 1 y . showString ")" prettyPrec :: Pretty a => Int -> a -> String prettyPrec d x = prettysPrec d x "" prettys :: Pretty a => a -> ShowS prettys = prettysPrec 0 pretty :: Pretty a => a -> String pretty x = prettyPrec minBound x