buildbox-2.1.11.1: Rehackable components for writing buildbots and test harnesses.

Safe HaskellSafe
LanguageHaskell98

BuildBox.Pretty

Contents

Description

Pretty printing utils.

Synopsis

Documentation

class Pretty a where #

The member prettyList is only used to define the instance Pretty a => Pretty [a]. In normal circumstances only the pretty function is used.

Minimal complete definition

pretty

Methods

pretty :: a -> Doc #

prettyList :: [a] -> Doc #

Instances

Pretty Bool 

Methods

pretty :: Bool -> Doc #

prettyList :: [Bool] -> Doc #

Pretty Char 

Methods

pretty :: Char -> Doc #

prettyList :: [Char] -> Doc #

Pretty Double 

Methods

pretty :: Double -> Doc #

prettyList :: [Double] -> Doc #

Pretty Float 

Methods

pretty :: Float -> Doc #

prettyList :: [Float] -> Doc #

Pretty Int 

Methods

pretty :: Int -> Doc #

prettyList :: [Int] -> Doc #

Pretty Integer 

Methods

pretty :: Integer -> Doc #

prettyList :: [Integer] -> Doc #

Pretty () 

Methods

pretty :: () -> Doc #

prettyList :: [()] -> Doc #

Pretty Doc 

Methods

pretty :: Doc -> Doc #

prettyList :: [Doc] -> Doc #

Pretty Bytes # 

Methods

pretty :: Bytes -> Doc #

prettyList :: [Bytes] -> Doc #

Pretty Seconds # 

Methods

pretty :: Seconds -> Doc #

prettyList :: [Seconds] -> Doc #

Pretty Sized # 

Methods

pretty :: Sized -> Doc #

prettyList :: [Sized] -> Doc #

Pretty Used # 

Methods

pretty :: Used -> Doc #

prettyList :: [Used] -> Doc #

Pretty Timed # 

Methods

pretty :: Timed -> Doc #

prettyList :: [Timed] -> Doc #

Pretty BuildError # 
Pretty Platform # 

Methods

pretty :: Platform -> Doc #

prettyList :: [Platform] -> Doc #

Pretty Environment # 
Pretty a => Pretty [a] 

Methods

pretty :: [a] -> Doc #

prettyList :: [[a]] -> Doc #

Pretty a => Pretty (Maybe a) 

Methods

pretty :: Maybe a -> Doc #

prettyList :: [Maybe a] -> Doc #

Pretty a => Pretty (Range a) # 

Methods

pretty :: Range a -> Doc #

prettyList :: [Range a] -> Doc #

Pretty a => Pretty (Comparison a) # 

Methods

pretty :: Comparison a -> Doc #

prettyList :: [Comparison a] -> Doc #

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

Methods

pretty :: (a, b) -> Doc #

prettyList :: [(a, b)] -> Doc #

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

Methods

pretty :: (a, b, c) -> Doc #

prettyList :: [(a, b, c)] -> Doc #

padRc :: Int -> Char -> Doc -> Doc Source #

Right justify a doc, padding with a given character.

padR :: Int -> Doc -> Doc Source #

Right justify a string with spaces.

padLc :: Int -> Char -> Doc -> Doc Source #

Left justify a string, padding with a given character.

padL :: Int -> Doc -> Doc Source #

Left justify a string with spaces.

blank :: Doc Source #

Blank text. This is different different from empty because it comes out a a newline when used in a vcat.

pprEngDouble :: String -> Double -> Maybe Doc Source #

Pretty print an engineering value, to 4 significant figures. Valid range is 10^(-24) (y/yocto) to 10^(+24) (Y/Yotta). Out of range values yield Nothing.

examples:

  liftM render $ pprEngDouble "J" 102400    ==>   Just "1.024MJ"
  liftM render $ pprEngDouble "s" 0.0000123 ==>   Just "12.30us"
  

pprEngInteger :: String -> Integer -> Maybe Doc Source #

Like pprEngDouble but don't display fractional part when the value is < 1000. Good for units where fractional values might not make sense (like bytes).

renderIndent :: Pretty a => a -> String Source #

Render a thing as a string.

renderPlain :: Pretty a => a -> String Source #

Render a thing with no indenting.

ppr :: Pretty a => a -> Doc Source #

Orphan instances