Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Pretty printing class, simlar to Show
but nicer looking.
Note that the precedence level is a Rational
so there is an unlimited number of levels.
Based on Text.PrettyPrint.HughesPJ, which is re-exported.
Synopsis
- class Pretty a where
- pPrintPrec :: PrettyLevel -> Rational -> a -> Doc
- pPrint :: a -> Doc
- pPrintList :: PrettyLevel -> [a] -> Doc
- newtype PrettyLevel = PrettyLevel Int
- prettyNormal :: PrettyLevel
- prettyShow :: Pretty a => a -> String
- prettyParen :: Bool -> Doc -> Doc
- module Text.PrettyPrint.HughesPJ
Documentation
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
.
Nothing
pPrintPrec :: PrettyLevel -> Rational -> a -> Doc Source #
pPrintList :: PrettyLevel -> [a] -> Doc Source #
Instances
newtype PrettyLevel Source #
Level of detail in the pretty printed output. Level 0 is the least detail.
Instances
Show PrettyLevel Source # | |
Defined in Text.PrettyPrint.HughesPJClass | |
Eq PrettyLevel Source # | |
Defined in Text.PrettyPrint.HughesPJClass (==) :: PrettyLevel -> PrettyLevel -> Bool Source # (/=) :: PrettyLevel -> PrettyLevel -> Bool Source # | |
Ord PrettyLevel Source # | |
Defined in Text.PrettyPrint.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 # |
prettyShow :: Pretty a => a -> String Source #
Pretty print a value with the prettyNormal
level.
module Text.PrettyPrint.HughesPJ