ddc-core-0.4.2.1: Disciplined Disciple Compiler core language and type checker.

Safe HaskellNone
LanguageHaskell98

DDC.Core.Exp.Generic.Pretty

Synopsis

Documentation

type PrettyLanguage l = (Eq l, Pretty l, Pretty (GAnnot l), Pretty (GBind l), Pretty (GBound l), Pretty (GPrim l)) Source

Synonym for Pretty constraints on all language types.

breakWhen :: Bool -> Doc Source

Insert a line or a space depending on a boolean argument.

parens' :: Doc -> Doc Source

Wrap a Doc in parens, and indent it one level.

pprParen' :: Bool -> Doc -> Doc Source

Wrap a Doc in parens if the predicate is true.

isSimpleX :: GExp l -> Bool Source

Check if this is a simple expression that does not need extra spacing when being pretty printed.

isSimpleR :: GArg l -> Bool Source

Check if this is a simple argument that does not need extra spacing when being pretty printed.