pretty-1.1.3.3: Pretty-printing library

Copyright(c) Trevor Elliott <revor@galois.com> 2015
LicenseBSD-style (see the file LICENSE)
MaintainerDavid Terei <code@davidterei.com>
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Text.PrettyPrint.Annotated.HughesPJClass

Contents

Description

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. This module re-exports HughesPJ.

Synopsis

Pretty typeclass

class Pretty a where #

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.

Minimal complete definition

pPrintPrec | pPrint

Methods

pPrintPrec :: PrettyLevel -> Rational -> a -> Doc ann #

pPrint :: a -> Doc ann #

pPrintList :: PrettyLevel -> [a] -> Doc ann #

Instances

Pretty Bool # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Bool -> Doc ann #

pPrint :: Bool -> Doc ann #

pPrintList :: PrettyLevel -> [Bool] -> Doc ann #

Pretty Char # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Char -> Doc ann #

pPrint :: Char -> Doc ann #

pPrintList :: PrettyLevel -> [Char] -> Doc ann #

Pretty Double # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Double -> Doc ann #

pPrint :: Double -> Doc ann #

pPrintList :: PrettyLevel -> [Double] -> Doc ann #

Pretty Float # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Float -> Doc ann #

pPrint :: Float -> Doc ann #

pPrintList :: PrettyLevel -> [Float] -> Doc ann #

Pretty Int # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Int -> Doc ann #

pPrint :: Int -> Doc ann #

pPrintList :: PrettyLevel -> [Int] -> Doc ann #

Pretty Integer # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Integer -> Doc ann #

pPrint :: Integer -> Doc ann #

pPrintList :: PrettyLevel -> [Integer] -> Doc ann #

Pretty Ordering # 
Pretty () # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> () -> Doc ann #

pPrint :: () -> Doc ann #

pPrintList :: PrettyLevel -> [()] -> Doc ann #

Pretty a => Pretty [a] # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> [a] -> Doc ann #

pPrint :: [a] -> Doc ann #

pPrintList :: PrettyLevel -> [[a]] -> Doc ann #

Pretty a => Pretty (Maybe a) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Maybe a -> Doc ann #

pPrint :: Maybe a -> Doc ann #

pPrintList :: PrettyLevel -> [Maybe a] -> Doc ann #

(Pretty a, Pretty b) => Pretty (Either a b) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> Either a b -> Doc ann #

pPrint :: Either a b -> Doc ann #

pPrintList :: PrettyLevel -> [Either a b] -> Doc ann #

(Pretty a, Pretty b) => Pretty (a, b) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b) -> Doc ann #

pPrint :: (a, b) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b)] -> Doc ann #

(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c) -> Doc ann #

pPrint :: (a, b, c) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c)] -> Doc ann #

(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d) -> Doc ann #

pPrint :: (a, b, c, d) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c, d)] -> Doc ann #

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e) => Pretty (a, b, c, d, e) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e) -> Doc ann #

pPrint :: (a, b, c, d, e) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c, d, e)] -> Doc ann #

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f) => Pretty (a, b, c, d, e, f) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f) -> Doc ann #

pPrint :: (a, b, c, d, e, f) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f)] -> Doc ann #

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g) => Pretty (a, b, c, d, e, f, g) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f, g) -> Doc ann #

pPrint :: (a, b, c, d, e, f, g) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f, g)] -> Doc ann #

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h) => Pretty (a, b, c, d, e, f, g, h) # 

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f, g, h) -> Doc ann #

pPrint :: (a, b, c, d, e, f, g, h) -> Doc ann #

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f, g, h)] -> Doc ann #

prettyNormal :: PrettyLevel #

The "normal" (Level 0) of detail.

prettyShow :: Pretty a => a -> String #

Pretty print a value with the prettyNormal level.

prettyParen :: Bool -> Doc ann -> Doc ann #

Deprecated: Please use maybeParens instead

Parenthesize an value if the boolean is true.