aboutsummaryrefslogtreecommitdiff
path: root/src/HSVIS/Pretty.hs
blob: cc8cb2ae5f2ca7bd3a130149bc1be1d0aa6e369e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module HSVIS.Pretty where

import Data.Void


class Pretty a where
  prettysPrec :: Int -> a -> ShowS

instance Pretty Void where
  prettysPrec _ = absurd

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