Copyright | (c) Trevor Elliott <[email protected]> 2015 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | David Terei <[email protected]> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Synopsis
- class Pretty a where
- newtype PrettyLevel = PrettyLevel Int
- prettyNormal :: PrettyLevel
- prettyShow :: Pretty a => a -> String
- prettyParen :: Bool -> Doc ann -> Doc ann
- module Text.PrettyPrint.Annotated.HughesPJ
Pretty typeclass
Pretty printing class. The precedence level is used in a similar way as in
the Show
class. Minimal complete definition is either pPrintPrec
or
pPrint
.
pPrintPrec :: PrettyLevel -> Rational -> a -> Doc ann Source #
pPrint :: a -> Doc ann Source #
pPrintList :: PrettyLevel -> [a] -> Doc ann Source #
Instances
newtype PrettyLevel Source #
Level of detail in the pretty printed output. Level 0 is the least detail.
Instances
Eq PrettyLevel Source # | |
Defined in Text.PrettyPrint.Annotated.HughesPJClass (==) :: PrettyLevel -> PrettyLevel -> Bool Source # (/=) :: PrettyLevel -> PrettyLevel -> Bool Source # | |
Ord PrettyLevel Source # | |
Defined in Text.PrettyPrint.Annotated.HughesPJClass compare :: PrettyLevel -> PrettyLevel -> Ordering Source # (<) :: PrettyLevel -> PrettyLevel -> Bool Source # (<=) :: PrettyLevel -> PrettyLevel -> Bool Source # (>) :: PrettyLevel -> PrettyLevel -> Bool Source # (>=) :: PrettyLevel -> PrettyLevel -> Bool Source # max :: PrettyLevel -> PrettyLevel -> PrettyLevel Source # min :: PrettyLevel -> PrettyLevel -> PrettyLevel Source # | |
Show PrettyLevel Source # | |
Defined in Text.PrettyPrint.Annotated.HughesPJClass |
prettyNormal :: PrettyLevel Source #
The "normal" (Level 0) of detail.
prettyShow :: Pretty a => a -> String Source #
Pretty print a value with the prettyNormal
level.
prettyParen :: Bool -> Doc ann -> Doc ann Source #
Deprecated: Please use maybeParens
instead
Parenthesize an value if the boolean is true.