PPrinter-0.1.0: A generic derivable Haskell pretty printer

Safe HaskellSafe
LanguageHaskell2010

Text.PPrinter

Synopsis

Documentation

class Pretty a where Source

Minimal complete definition

ppPrec | pp

Methods

ppPrec Source

Arguments

:: Int

the operator precedence of the enclosing context

-> a

the value to be converted to a String

-> DOC

the result

ppPrec converts a value to a pretty printable DOC.

pp :: a -> DOC Source

pp is the equivalent of show

genList :: [a] -> DOC Source

ppList :: [a] -> DOC Source

ppList is the equivalent of showList

Instances

Pretty Bool Source 
Pretty Char Source 
Pretty Double Source 
Pretty Float Source 
Pretty Int Source 
Pretty Integer Source 
Pretty Ordering Source 
Pretty () Source 
Pretty a => Pretty [a] Source 
Pretty a => Pretty (Maybe a) Source 
(Pretty a, Pretty b) => Pretty (Either a b) Source 
(Pretty a, Pretty b) => Pretty (a, b) Source 
(Pretty a, Pretty b) => Pretty (Map a b) Source 
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) Source 
(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e) => Pretty (a, b, c, d, e) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f) => Pretty (a, b, c, d, e, f) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g) => Pretty (a, b, c, d, e, f, g) Source 
(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) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h, Pretty i) => Pretty (a, b, c, d, e, f, g, h, i) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h, Pretty i, Pretty j) => Pretty (a, b, c, d, e, f, g, h, i, j) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h, Pretty i, Pretty j, Pretty k) => Pretty (a, b, c, d, e, f, g, h, i, j, k) Source 
(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h, Pretty i, Pretty j, Pretty k, Pretty l) => Pretty (a, b, c, d, e, f, g, h, i, j, k, l) Source 

data Style Source

A rendering style

Constructors

Style 

Fields

mode :: Mode

The redering mode

lineLen :: Int

Length of line

pprint :: Show a => Pretty a => a -> IO () Source

pprintLen :: Show a => Pretty a => Int -> a -> IO () Source

pprintStyle :: Show a => Pretty a => Style -> a -> IO () Source

The default Pretty Printer

class Generic a

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

Minimal complete definition

from, to

Instances

Generic Bool 
Generic Char 
Generic Double 
Generic Float 
Generic Int 
Generic Ordering 
Generic () 
Generic Arity 
Generic Fixity 
Generic Associativity 
Generic [a] 
Generic (U1 p) 
Generic (Par1 p) 
Generic (Maybe a) 
Generic (Either a b) 
Generic (Rec1 f p) 
Generic (a, b) 
Generic (Proxy * t) 
Generic (K1 i c p) 
Generic ((:+:) f g p) 
Generic ((:*:) f g p) 
Generic ((:.:) f g p) 
Generic (a, b, c) 
Generic (M1 i c f p) 
Generic (a, b, c, d) 
Generic (a, b, c, d, e) 
Generic (a, b, c, d, e, f) 
Generic (a, b, c, d, e, f, g)