on 2a930fd help sign in
elk/src/Type/PrettyPrint.hs
16 lines 347 B history raw
2module Type.PrettyPrint where
4import Text.PrettyPrint
5import qualified AST.PrettyPrint as Src
7data ParensWhen = Fn | App | Never
9class PrettyType a where
10 pretty :: ParensWhen -> a -> Doc
12commaSep :: [Doc] -> Doc
13commaSep docs = sep (punctuate comma docs)
15parensIf :: Bool -> Doc -> Doc
16parensIf bool doc = if bool then parens doc else doc