@@ -1,16 +1,20 @@
2module Type.PrettyPrint where
1module Type.PrettyPrint where
4import Text.PrettyPrint
3import Text.PrettyPrint
5−import qualified AST.PrettyPrint as Src
4+
7data ParensWhen = Fn | App | Never
6data ParensWhen = Fn | App | Never
9class PrettyType a where
9class PrettyType a where
10− pretty :: ParensWhen -> a -> Doc
10+ pretty :: ParensWhen -> a -> Doc
12commaSep :: [Doc] -> Doc
13commaSep :: [Doc] -> Doc
13−commaSep docs = sep (punctuate comma docs)
15+ sep (punctuate comma docs)
15parensIf :: Bool -> Doc -> Doc
18parensIf :: Bool -> Doc -> Doc
16−parensIf bool doc = if bool then parens doc else doc
20+ if bool then parens doc else doc